Jump to content

Header Cache


The Little Guy

Recommended Posts

How come if I place this at the top of the page, it doesn't work?

 

header( "Cache-Control: no-store, no-cache, must-revalidate" );
header( "Cache-Control: post-check=0, pre-check=0", false );
header( "Pragma: nocache" );

 

I have a script that rotates images, then saves them, along with the new thumbnail, but when the page that I display the image on reloads, the image thumbnail hasn't change. If i press F5, or ctrl+F, or Refresh, then the thumbnail changes to the new updated image.

 

The above code is on the saves the new rotated image file, and on the page that displays the thumbnail.

 

Link to comment
Share on other sites

Ahhh got my headers confused....

 

Last-Modified being in the past means that the client would check that the new page is older than the cache, so don't update it ;p.

 

Remove that one I said a sec ago, and try using:

 

Expires: Thu, 01 Dec 1994 16:00:00 GMT

Link to comment
Share on other sites

Nope... That doesn't work either...

 

Here is what I have now:

 

<?php
header( "Cache-Control: no-store, no-cache, must-revalidate" );
header( "Cache-Control: post-check=0, pre-check=0", false );
header( "Pragma: nocache" );
header("Cache: no-cahce");
header("Expires: Thu, 01 Dec 1994 16:00:00 GMT");
?>

 

Does that look right?

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.