pneudralics Posted May 28, 2009 Share Posted May 28, 2009 <meta http-equiv="Pragma" content="no-cache" /> I have that in my header which works on pages that have my header included and have stopped IE from caching. I don't want browsers to cache my require() files. If I were to require('requirefile.php'); and type in the url browser localhost/requirefile.php it'll still show my information saved from the cookie even after I logged out until I open a new tab or window. This seems to only be happening with IE. Anyways anything other than the meta to stop caching that I can add in my require files? Quote Link to comment https://forums.phpfreaks.com/topic/159994-is-there-some-kind-of-php-to-dont-allow-browsers-to-cache-files/ Share on other sites More sharing options...
Adam Posted May 28, 2009 Share Posted May 28, 2009 If you're using Apache: http://www.askapache.com/htaccess/using-http-headers-with-htaccess.html#prevent-caching-with-htaccess You may also want to take a look at: http://www.mnot.net/cache_docs/ Quote Link to comment https://forums.phpfreaks.com/topic/159994-is-there-some-kind-of-php-to-dont-allow-browsers-to-cache-files/#findComment-843933 Share on other sites More sharing options...
Daniel0 Posted May 28, 2009 Share Posted May 28, 2009 The only thing you can do is to kindly request the user agents that they do not cache anything. You can't enforce it. Quote Link to comment https://forums.phpfreaks.com/topic/159994-is-there-some-kind-of-php-to-dont-allow-browsers-to-cache-files/#findComment-843935 Share on other sites More sharing options...
redarrow Posted May 28, 2009 Share Posted May 28, 2009 It was news to me too. In order to assure a non-cache, you'll need to add another meta tag: <META HTTP-EQUIV="Expires" CONTENT="-1"> That sets an immediate expiration on the file. Thus it dies the moment is it born. Place it on your page in the same manner as above. Since you still have the 64k buffer problem to worry about, I would place it in both HEAD tag sections. Better to be safe than sorry. It should look like this: <HTML> <HEAD> <TITLE>---</TITLE> <META HTTP-EQUIV="Pragma" CONTENT="no-cache"> <META HTTP-EQUIV="Expires" CONTENT="-1"> </HEAD> <BODY> Text in the Browser Window </BODY> <HEAD> <META HTTP-EQUIV="Pragma" CONTENT="no-cache"> <META HTTP-EQUIV="Expires" CONTENT="-1"> </HEAD> </HTML> Quote Link to comment https://forums.phpfreaks.com/topic/159994-is-there-some-kind-of-php-to-dont-allow-browsers-to-cache-files/#findComment-844004 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.