Jump to content

[SOLVED] IE caches PHP output. workaround?


Darkstar

Recommended Posts

Let me start at the beginning.  Somebody wanted me to code their website and it's a photography site so I wanted to disallow image downloads for obvious reasons.  I was going to use a few tricks to accomplish this.  I would overlay a transparent image over the actual image so that if somebody right clicks and hits save as they don't get the image.  If they're smart enough to view source they'd see the following:

 

<img src="nodownload.php?image=image.jpg">

nodownload.php checks to see if it's being called from in a page on a certain domain, if it is it'll use gd, grab the image and display it.  If the page is being hotlinked or no HTTP_REFERER then it'll watermark the picture with GD then output it.

 

This works fine on firefox because firefox isn't caching the output of the php page so if they right type the url of the image it runs through the script again.  IE on the other hand is caching the output and displaying the picture it displayed when called from the <img> tag which defeats the purpose of having the code at all if it's going to get cached.

 

I need a way to force all browsers to run the script (not the containing page) instead of caching it.  Thoughts?

If not, is there a better way or doing this other than mod_rewrite?  If it comes down to it I guess I could simply use mod_rewrite to redirect to an error page.

Link to comment
Share on other sites

Doesn't really matter either way... If you don't want images stolen, then a huge watermark should be on each image (large or small, or in between). If there's a way to load an image through a normal click and view it (not right-clicking it), then I can just hit ALT-PRINT_SCREEN, and I now have the picture in my clipboard. I can paste it right into Photoshop or any other graphics program and save it. No need to be 'smart enough to view the source' if I'm viewing it right on my monitor...

 

PhREEEk

Link to comment
Share on other sites

although true, most people wouldn't go through the trouble although you're right, I should watermark them regardless.  I just wanted it to be at least a little friendly if you were looking at the pictures on the site.  I know that I hate going to sites and seeing watermarks on images that are simply being displayed in the page.  Maybe the solution i'm looking for is smaller thumbnails that link to a watermarked, larger image.

Link to comment
Share on other sites

that wouldn't solve it, unfortunately.  The number would be appended but if you copy the URL and type it in the addressbar in IE it'll be cached because the randomizer won't change from the img src to the time it's loaded by itself.  That would work if I needed it displayed differently on 2 pages but not if it's being called by itself.

Link to comment
Share on other sites

>most people wouldn't go through the trouble

 

That's contradictory if you are saying they will go through the trouble of checking the source and trying to directly download the image (which is why you need this to begin with), but not simply pressing ALT-PRINT SCREEN.

 

If a watermak is done correctly, then it should not interfere with the viewing of the photo, yet totally protect it at the same time. All I'm saying is, you are building a custom script and spending time doing something that isn't going to provide any real protection. If your customer is paying to create this non-protection, then they are going to get ripped off, and probably pissed off. If you are doing it for free, you are wasting your time and will still endup with a pissed off client.

 

You have to be honest with them about how it works... scripts can't protect everything. Get a proper watermark system in place, and drop the script idea.

 

PhREEEk

Link to comment
Share on other sites

Basically what I want to avoid is what you hit on, an obtrusive watermark that takes away from the experience of viewing the images.  What I also don't want to have to do is open up photoshop for every image and manually watermark it because that'll take a considerable amount of time.  So let me run this past you:

 

I was originally going to use a script to add all new photos to the database and then prompt you for categories it would show up in.  I figure I can make the the watermark part of this process and prompt me for where (in coordinates) to put it so it looks unobtrusive.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.