michal
michal

Reputation: 101

Internet Explorer (6 and higher) cache and temporary files

How to prevent browser from storing particular page in temporary files folder ? Is there any solution using meta tags ? i've tried with meta tag: pragma, expire, cache-control but it doesnt work.

Upvotes: 2

Views: 5620

Answers (4)

i_am_jorf
i_am_jorf

Reputation: 54600

No, you can't. MSHTML must store the file for some short period of time in order to render it. It is a built-in design requirement.

Upvotes: 0

LiamB
LiamB

Reputation: 18586

One way I've used in the past is to append a unique value to the query

eg: ImageGen.php?rid=548268

rid being a random gnerated number.

Upvotes: 0

BalusC
BalusC

Reputation: 1108722

Here is the complete set of response headers which ought to work in all browsers:

<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate">
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Expires" content="0">

The Cache-Control is according the HTTP 1.1 specification. The Pragma is according the HTTP 1.0 specification. The Expires is to avoid Proxies to cache the content.

If this still fails, then you just need to clear the browser cache before testing.

If still in vain, then the problem lies somewhere else. Common case is that starters think that the included files like scripts, stylesheets and images are cached according the instructions of the parent page. This is thus not true. They all account as independent requests and thus have their own set of controllable response headers.

Upvotes: 2

T.J. Crowder
T.J. Crowder

Reputation: 1074285

This question (or more to the point, its answers) should help. I don't think there's any way to be certain that the browser won't write the content to a temporary file (for purposes other than caching), though.

Upvotes: 0

Related Questions