Jump to content

cache


mistakes!

Recommended Posts

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?
Link to comment
https://forums.phpfreaks.com/topic/9345-cache/
Share on other sites

[!--quoteo(post=372433:date=May 8 2006, 06:09 PM:name=mistakes!)--][div class=\'quotetop\']QUOTE(mistakes! @ May 8 2006, 06:09 PM) [snapback]372433[/snapback][/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
Link to comment
https://forums.phpfreaks.com/topic/9345-cache/#findComment-34449
Share on other sites

Archived

This topic is now archived and is closed to further replies.

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