Project / Support Center
Welcome, %1$s. Please login or register. February 28, 2024, 09:42: AM
Web Global Net Web Application & Web Development Project Center  |  Technical Issues  |  php related  |  : How to prevent Browser cache for php site 0 and 1 Guest are viewing this topic. « previous next »
: [1]
: How to prevent Browser cache for php site  ( 5187 )
admin
Administrator
******


: 239


« : August 11, 2021, 07:34: PM »

Here, if you want to control it through HTML: do like below Option 1:

<meta http-equiv="expires" content="Sun, 01 Jan 2021 00:00:00 GMT"/>
<meta http-equiv="pragma" content="no-cache" />
 
And if you want to control it through PHP: do it like below Option 2:

header('Expires: Sun, 01 Jan 2021 00: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');

AND Option 2 IS ALWAYS BETTER in order to avoid proxy based caching issue.
 

The Unknown Webmaster
: [1]  
Web Global Net Web Application & Web Development Project Center  |  Technical Issues  |  php related  |  : How to prevent Browser cache for php site « previous next »
:  


Powered by MySQL Powered by PHP Valid XHTML 1.0! Valid CSS!
Sorry, the copyright must be in the template.
Please notify this forum's administrator that this site is missing the copyright message for SMF so they can rectify the situation. Display of copyright is a legal requirement. For more information on this please visit the Simple Machines website.