Not sure which forum this belongs in, code, client side or graphics!
I know there are various ways of controlling page caching, but could anyone tell me one that prevents image caching in browsers?
I have a logo upload script which resizes and renames a file to the id of the database entry, so when you upload a new image it overwrites the old 26.jpg for instance. The trouble is, IE still displays the old 26.jpg because it reloads it from its cache and not the server.
A second page refresh usually resolves it but it shouldn't be necessary.
Prevention of image caching
Moderator: General Moderators
- Skittlewidth
- Forum Contributor
- Posts: 389
- Joined: Wed Nov 06, 2002 9:18 am
- Location: Kent, UK
- Skittlewidth
- Forum Contributor
- Posts: 389
- Joined: Wed Nov 06, 2002 9:18 am
- Location: Kent, UK
Not sure what you mean by using a script to frontend the images, can you explain further?
I have
at the top of my script, and the image tag is generated dynamically depended on what entry in the database I'm editing. Am I misunderstanding the header parameters, because it still hasn't solved the problem in IE. The images aren't cached in FireFox.
I have
Code: Select all
header("Content-type: text/html");
header("Expires: Mon, 4 Dec 2006 05:00:00 GMT");
header("Cache-Control: no-store, no-cache,
must-revalidate");
header("Cache-Control: post-check=0, pre-check=0",
false);
header("Pragma: no-cache");