[thelist] Uncaching content

VOLKAN ÖZÇELİK volkan.ozcelik at gmail.com
Wed Apr 26 11:38:23 CDT 2006


> Don't-cache-this tips I've tried so far:
> - PHP sends a Cache-control header before the HTML to
>    turn off AOL's caching proxy.
> - meta-equiv headers to set Expires to "long ago", Pragma no-cache,
>    and CacheControl no-cache.
> - Per Microsoft's advice, I'm sending a SECOND "head" section after
>    the body with all the same items again, since IE may have discarded
>    the first set to make room for the image data. ("You've GOT to be
>    kidding!"  No, they really said that.)
> Cache-Control: no-store  <!-- http header sent by PHP -->

Well sometimes service providers do cache files so things go out of your
If that's the case, what you do on your server are not guaranteed to prevent

For instance at peak times the service provider may decide to send its
cached data to decrease the load. So nothing will work, including but not
limited to
- sending server side headers;
- deleting the temporary cache of the user agent.
- ctrl F5, ctrl+R etc.

Because, whenever client requests a new page the provider's proxy sends "hey
this is a brand new page take it" response to the client.

This issue bugged me a lot when I was developing a fat-client apllication
(before I left my full-time job and went solo ... oh those good old boring
days :) )

The only solution we found was to add a version number to the file names

src="http://example.com/lib/useractions/main.js?v=1.0.2" ...

and change the version number at each deployment.

We've discussed the issue with support professionals from IBM (both local
and US). And the end result did not change.

I can say that adding a random query string or a version number is pretty
much the only guaranteed way to prevent caching.

Volkan Ozcelik
+>Yep! I'm blogging! : http://www.volkanozcelik.com/volkanozcelik/blog/
+> My projects/studies/trials/errors : http://www.sarmal.com/

More information about the thelist mailing list