Jump to content

Is there some kind of php to don't allow browsers to cache files?


pneudralics

Recommended Posts

<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?

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>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.