On Jun 12, 2007, at 4:18 PM, Mike Orr wrote:
I added:resp.headers["cache-control"] = "public, max-age=360" But it behaves inconsistently so I'm thoroughly confused. Sometimes I get 304, sometimes not. Sometimes the "public" part appears in the Cache-control line in the response, sometimes not. Sometimes there's an Etag header, sometimes not. These changes do not necessarily reflect whether I've changed the relevant portion of the source, pressed shift-reload, or deleted the application's cache directory. The cache argument for StaticURIParser is 'cache_max_age', not 'max_cache_age'. The docstring says the latter but the code says the former, so watch out for that. With this I'm getting correct 304's, Etags, and Cache-control on my static files, but it's still checking the server each time. So the caching isn't perfect but it's better than nothing, at least part of the time.
That's because cache-control is not the same as etag. Cache-control indicates when the browser should even check the resource again, while ETag's are sent to determine if the resource is still valid for that ETag. Given a max-age of 6 minutes, how frequently is it checking the same resource?
- Ben
smime.p7s
Description: S/MIME cryptographic signature