FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


Page cache/refresh question





DoctorBeaver
Obviously it's better for pages to be cached, but what if an include changes on the page between loadings?

My specific question is about menus. I'm giving my members the option of choosing their own menu items. I'm writing the member's menu choices to a .txt file & using a php function to include them. So, a member goes into config & changes their menu options; if the menu.txt file has already been cached, how can I force the new menu.txt file to be loaded? Is there any way I can force an update? I know how to refresh a page, but I'm not sure about refreshing includes.
Stubru Freak
DoctorBeaver wrote:
Obviously it's better for pages to be cached, but what if an include changes on the page between loadings?

My specific question is about menus. I'm giving my members the option of choosing their own menu items. I'm writing the member's menu choices to a .txt file & using a php function to include them. So, a member goes into config & changes their menu options; if the menu.txt file has already been cached, how can I force the new menu.txt file to be loaded? Is there any way I can force an update? I know how to refresh a page, but I'm not sure about refreshing includes.


If it's a server-side include you have to refresh the whole page.
Ducksteina
This code will force the page to not cache:

Code:
<?PHP
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") ." GMT");
header("Pragma: no-cache");
header("Cache-Control: no-store, no-cache,
max-age=0, must-revalidate");
?>
Related topics
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.