Jump to content


Photo

Cache problem


  • Please log in to reply
2 replies to this topic

#1 jpistone

jpistone
  • Members
  • Pip
  • Newbie
  • 7 posts

Posted 15 May 2006 - 07:41 PM

Is there a way to overwrite a client's cache file? Suppose I have a file called "recent.pdf" and replace it daily., but keep the same name. When someone goes to the site, the browser calls up the cached version (yesterday's) instead of the newer one. Short of redesigning things, is there a quick fix to overwrite the file from the same originating site with the same name? Would a cookie do it? Thanks.

#2 ryanlwh

ryanlwh
  • Staff Alumni
  • Advanced Member
  • 511 posts

Posted 15 May 2006 - 07:44 PM

add this header to the script
header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past

Please use EDIT * 100...
Please use
or [php] * 1000...

PLEASE READ THE POSTED SOLUTIONS CAREFULLY * 1000000...

#3 jpistone

jpistone
  • Members
  • Pip
  • Newbie
  • 7 posts

Posted 15 May 2006 - 07:48 PM

[!--quoteo(post=374109:date=May 15 2006, 07:44 PM:name=ryanlwh)--][div class=\'quotetop\']QUOTE(ryanlwh @ May 15 2006, 07:44 PM) View Post[/div][div class=\'quotemain\'][!--quotec--]
add this header to the script
header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past
[/quote]

Hey, thanks, ryanlwh! I was hoping it would be short 'n sweet!




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users