mr_pita — 2010-07-23T14:24:35-04:00 — #1
I have an image site set so that if an image is linked to directly (meaning if the referrer isn't my site) then it redirects to the page that the image is on.
This works fine for FF and IE, but in Chrome and probably Safari, after the redirect the image doesn't show up because the browser has already cached it as a redirect. Only after a refresh does it show up.
Any way around this?
dklynn — 2010-07-23T21:04:10-04:00 — #2
Once a file is downloaded to a browser (and placed in its cache), there is nothing which you can do to prevent the browser from extracting it from its own cache.
With HTML (PHP, etc) files which render as a page, it's a simple matter to include expiry data IN THE SCRIPT. With images, that's just not possible.
mr_pita — 2010-07-23T15:50:14-04:00 — #3
I thought about that, but I didn't like the inconsistency of having a different file name each time. As long as it works (does anybody know if browsers don't just ignore the extra stuff at the end?), then I suppose I'll go with it.
aquilax — 2010-07-23T15:33:10-04:00 — #4
Use random parameter to the file name on the page.
<img src="image.png?123321" />