BillyT Posted March 4, 2009 Share Posted March 4, 2009 Hi there I posted this on another thread but thought it deserved its own. I have a php script that multiple users access that has something like session_start(); include('../common.php'); echo $someVar; in common.php it accesses the session vars and and sets values for other vars eg $num=$_SESSION['num']; $someVar = $num+5; Is it possible for 2 users to hit the script in quick succession and for the server to return cached values to the second user, and thereby pass this second user the values from the first users session? So for example, let's say in user 1, $_SESSION['num']=5; and in user 2, $_SESSION['num']=25; user 1 loads page and it displays 10. user 2 then loads page and it should display 30 but is it possible for the server to say "i've cached common.php and I already know $someVar = 10 so I'll return that to user 2". I'm guessing this can't happen but just want to make sure. Thanks in advance Link to comment https://forums.phpfreaks.com/topic/147914-can-vars-in-include-file-be-cached/ Share on other sites More sharing options...
phpdragon Posted March 4, 2009 Share Posted March 4, 2009 server cache only stores html output i believe so the variables in common.php would never be cached as they are pre output and would be set everytime it loads Link to comment https://forums.phpfreaks.com/topic/147914-can-vars-in-include-file-be-cached/#findComment-776338 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.