Jump to content

Stop Cache


Recommended Posts

Didnt know if this should be in DBS support, But it could be used for many things, so i posted here..

On a script ive made, an user verification script, the image allways stays the same, in FF it doesnt and image destroy function does the trick..... and the cache isnt stored.

But in IE, the image is allways the same but it has different hidden values, so what the user types in will allways be wrong seeing as there seeing the wrong image.

Ive tried obvious things like...


header("Cache-control: no-cache");
header("Expires: " . gmdate("D, d M Y H:i:s") . " GMT");


Doesnt work in IE still :-(

Any idea what will stop cache all together on the page?


Link to comment
Share on other sites

Re: Stop Cache

Something like this should work:


Header( "Last-Modified: " . gmdate( "D, j M Y H:i:s" ) . " GMT" );
Header( "Expires: " . gmdate( "D, j M Y H:i:s", time() ) . " GMT" );
Header( "cache-Control: no-store, no-cache, must-revalidate" ); // HTTP/1.1
Header( "cache-Control: post-check=0, pre-check=0", FALSE );
Header( "Pragma: no-cache" ); // HTTP/1.0


I didn't have a chance to test it however, but give it a try and let us know.

Link to comment
Share on other sites

Guest Anonymous

Re: Stop Cache

Maby try this

header( “Expires: Mon, 26 Jul 1997 05:00:00 GMT” );

header( “Last-Modified: ” . gmdate( “D, d M Y H:i:s” ) . ” GMT” );

header( “Cache-Control: no-cache, must-revalidate” );

header( “Pragma: no-cache” );

Link to comment
Share on other sites

Join the conversation

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

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  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...