Closed sekjal closed 8 years ago
Yeah this should be set to a proper caching policy. ;D PRs welcome.
Experimenting with the existing configuration options, I think an additional configuration parameter may be unnecessary. By modifying the cacheHeaders config to:
cacheHeaders: '/^(X\-)|(Cache\-Control)|(Etag)|(Expires)|(Last\-Modified)/i'
I am able to specify my configuration preferences in .htaccess.
Should this be the new default for this config option, or just documented?
Probably a new default setting. ;)
By starting the session first thing in DynamicCache::run(), the default session_cache_limiter of 'nocache' is set, which results in the headers
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
being set on items served from dynamiccache. These do not seem to be affected by .htaccess rules using mod_header.c.
While this does have the advantage of handing over "freshness" checking to the server (so content updates are distributed immediately), it prevents browser caching and proxying, which may be appropriate for a particular seldom-changing page. Not usually a huge issue with LAN or solid wireless connections, but network overhead can be a significant performance issue on mobile.
Perhaps make this a configurable variable, so administrators can tune the behavior to their application?