PHP Page not refreshing - retrieving from the cache

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
anjanesh
DevNet Resident
Posts: 1679
Joined: Sat Dec 06, 2003 9:52 pm
Location: Mumbai, India

PHP Page not refreshing - retrieving from the cache

Post by anjanesh »

I have some php pages - all of them have a line print(include("menu.php")); which shows the menu. The menu is dynamic.

menu.php
========

Code: Select all

<?php
$strMenu='some table';
if(isset($PHPSESSID))
 $strMenu.='<td>logout</td>';
else
 $strMenu.='<td>login</td>';
return $strMenu;
?>
When we enter the site at first, it'll be login cell. After loging in, the logout cell shows.
But unfortunately the menu is loaded only once for each page which it looks into the cache to retieve the menu.php.
If I refresh the page the correct menu items get displayed.
My sessions etc are working OK.
I just need to get this fixed. (Perhaps an automatic refresh ? But that'll load all the images all over again.)
Thanks
User avatar
anjanesh
DevNet Resident
Posts: 1679
Joined: Sat Dec 06, 2003 9:52 pm
Location: Mumbai, India

Post by anjanesh »

Regarding the abpove topic :
If I set the option in Internet Options - Settings -

Check for newer version of stored pages :
Every visit to the page
Every time you start IE
Automatically
Never

to
Every visit to the page then it works alright.
But the default is Automatically

So how do I get to refresh that page from the server on every visit ? I thought this only applies to html files. Did not know that php files are also stored in cache.
Post Reply