Jump to content


Photo

cache


  • Please log in to reply
1 reply to this topic

#1 mistakes!

mistakes!
  • Members
  • PipPip
  • Member
  • 12 posts

Posted 08 May 2006 - 10:09 PM

hello. i know this headers are for caching control henceb the browser is not allowed to cache the pages locally

header('Expires: Mon, 26 Jul 1997 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');

apart from that what else does it do for me? how does ot make my programme better?

#2 phporcaffeine

phporcaffeine
  • Members
  • PipPipPip
  • Advanced Member
  • 361 posts
  • LocationOhio, USA

Posted 08 May 2006 - 10:15 PM

[!--quoteo(post=372433:date=May 8 2006, 06:09 PM:name=mistakes!)--][div class=\'quotetop\']QUOTE(mistakes! @ May 8 2006, 06:09 PM) View Post[/div][div class=\'quotemain\'][!--quotec--]
hello. i know this headers are for caching control henceb the browser is not allowed to cache the pages locally

header('Expires: Mon, 26 Jul 1997 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');

apart from that what else does it do for me? how does ot make my programme better?
[/quote]

It depends on wether you want the page cached or not. If it is a page that updates frequently then you probably would want those headers.

Those headers are just preventing cache by setting the cache expiration to an obviously past tense date. They all work together to basically do the same thing

header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); //SET EXPIRATION

header('Cache-Control: no-store, no-cache, must-revalidate'); // TELLS BROWSER THAT IF CACHED IT SHOULDN'T USE IT

header('Cache-Control: post-check=0, pre-check=0', FALSE); //NULLIFIES RAW DATA

header('Pragma: no-cache'); //GENERALLY FOR CROSS BROWSER COMPATIBILITY
Thanks,

Ryan Huff
President & Founder, MyCodeTree
support@mycodetree.com | http://mycodetree.com




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users