[WEB4LIB] cache

Thomas Dowling tdowling at ohiolink.edu
Mon Feb 28 10:38:11 EST 2000


----- Original Message -----
From: "stéphane dudart" <dudart at bse.ucl.ac.be>



> hi,
>
> Does someone know a means to change cache functionnalities of user
agents
> to stop the storage of web pages?
>
> Thank you
>
> Stéphane D.

If you actually want to change a user agent's functionality, check its
configuration or preference options.  Any good browser lets you configure
this.

If you want to control caching from the server end, the most common trick
used by authors is to include in an HTML document's HEAD:

  <meta http-equiv="Pragma" content="no-cache">

A well-behaved browser will interpret this as though it had received an
actual "Pragma: no-cache" HTTP header from the server, and not cache the
document.  Be aware that this has two likely points of failure.  First,
intermediary proxies or gateways can only honor this if they are actually
opening and reading every HTML document they process.  Some (many? most?)
do not, and will cache this as per their defaults.  Second, this can only
work on HTML, and not on other file types, including images.  To solve
both of these problems, you need to dig around in your server
documentation to figure out how to get the server itself to send the
no-cache directive as a real HTTP header.  For Apache, read up on the
Header and the Expires directives; be aware that both directives rely on
modules that are not compiled in by default, which probably means
recompiling Apache.

If you want a finer degree of control over the way caches treat your
documents, and if your server and a substantial percentage of your users
are talking HTTP 1.1, you can use the Cache-control header instead of the
single-purpose Pragma header.  Cache-control allows you to specify whether
a document should be cached in private browser caches, or in public proxy
caches; how long it should be cached, etc.  If you're happy with a blanket
"Don't cache this" message, Pragma is more widely supported.

Thomas Dowling
OhioLINK - Ohio Library and Information Network
tdowling at ohiolink.edu




More information about the Web4lib mailing list