A very cheap trick to stop images from being cached is to diddle the URI in the <img> element on the page. Instead of emitting:
<img src="thumbnail-left.png"> <img src="thumbnail-right.png">
Into the outgoing page, add a bogus GET parameter that makes them unique:
<img src="thumbnail-left.png?4608fe05888c"> <img src="thumbnail-right.png?4608fe0ab9b9">
Which, unless you have some weird'n'wacky image handler, will be ignored by your server and the client will be forced to reload the images each time due to the GET parameter, which will inhibit its ability to cache.
And in case you were wondering, I generated the above with sprintf "%x%0x\n", time, rand(65535);. Adjust as appropriate.
This is far less hassle than having to fiddle around with cache/no-cache parameters.
• another intruder with the mooring in the heart of the Perl
In reply to Re: Slightly OT: Stop caching images
by grinder
in thread Slightly OT: Stop caching images
by astroboy
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |