The Little Guy Posted October 12, 2007 Share Posted October 12, 2007 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. Quote Link to comment https://forums.phpfreaks.com/topic/72890-header-cache/ Share on other sites More sharing options...
corbin Posted October 12, 2007 Share Posted October 12, 2007 You could try adding a Last-Modified header.... Not sure if that would fix it, but I suspect it might. Example: Last-Modified: Wed, 15 Nov 1995 04:58:08 GMT Quote Link to comment https://forums.phpfreaks.com/topic/72890-header-cache/#findComment-367639 Share on other sites More sharing options...
The Little Guy Posted October 12, 2007 Author Share Posted October 12, 2007 Nope didn't work Quote Link to comment https://forums.phpfreaks.com/topic/72890-header-cache/#findComment-367641 Share on other sites More sharing options...
corbin Posted October 12, 2007 Share Posted October 12, 2007 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 Quote Link to comment https://forums.phpfreaks.com/topic/72890-header-cache/#findComment-367642 Share on other sites More sharing options...
The Little Guy Posted October 12, 2007 Author Share Posted October 12, 2007 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? Quote Link to comment https://forums.phpfreaks.com/topic/72890-header-cache/#findComment-368036 Share on other sites More sharing options...
Aureole Posted October 12, 2007 Share Posted October 12, 2007 Try putting the Expires header first. ??? Quote Link to comment https://forums.phpfreaks.com/topic/72890-header-cache/#findComment-368056 Share on other sites More sharing options...
The Little Guy Posted October 15, 2007 Author Share Posted October 15, 2007 Nope, didn't work. Quote Link to comment https://forums.phpfreaks.com/topic/72890-header-cache/#findComment-369738 Share on other sites More sharing options...
nezbo Posted October 15, 2007 Share Posted October 15, 2007 Sorry to be slightly off toppick. but i have noticed this bit of code header("Expires: Thu, 01 Dec 1994 16:00:00 GMT"); dose this make the page check for new data every time the page is loaded to save pressing F5 or Ctrl + F5 Neil Quote Link to comment https://forums.phpfreaks.com/topic/72890-header-cache/#findComment-369807 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.