|
Posted by Alan J. Flavell on 03/08/06 17:24
On Wed, 8 Mar 2006, Jim Higson wrote:
> I'm working on a server app, which makes resources with the creation
> time in the URL, so they are guarantied never to change once put up.
>
> Because the resource for a given URL never changes, browser cache is
> always safe to use and there is no need to revalidate. What are the
> best HTTP header(s) to use to indicate this, and how should they be
> set in Apache?
To the best of my knowledge, I'd say that setting an Expires header in
the distant future is all that it really needs. Apache will be
sending the usual cacheability data at the same time (unless you were
doing something to prevent that). Caches make their own decisions
about whether they're going to check or not. Trying to force them to
behave in one way or another, contrary to their inclinations based on
the actual properties of the page, seems to be rarely helpful, and
sometimes counterproductive. So unless you're a world expert in
Cache-control headers, I'd say you'd be safer to leave those out, than
to risk inadvertently saying the wrong thing.
Verify that you're getting the results that you intended, by pointing
Mark Nottingham's "cacheability engine" at some typical pages.
h t h
[Back to original message]
|