[dokuwiki] Re: Cache Expiry Standardisation

  • From: Ben Coburn <btcoburn@xxxxxxxxxxxxx>
  • To: dokuwiki@xxxxxxxxxxxxx
  • Date: Fri, 31 Mar 2006 03:03:35 -0800

On Mar 31, 2006, at 1:19 AM, Andreas Gohr wrote:

On Fri, 31 Mar 2006 11:12:30 +0200
Andreas Gohr <andi@xxxxxxxxxxxxxx> wrote:

It looks like the js handler sends headers which tells the browser
not to cache css & js.

Uhh that shouldn't be the case and needs to be investigated.

Well there are the following lines:

header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Pragma: public');

They force the browser to check the files on every request, usually
using an if-modified-since conditional request which will be answered
with a 403 - not changed answer by dokuwiki. However I guess this
should be improved to tell the browser to send its IMS-Request only
every few minutes.

I think header('Cache-Control: max-age=120'); should do it but I'm no
expert. Any other suggestions?

FYI, this is not really the case for Firefox on MacOS.... Try watching the
access log in real-time while making requests. With the current headers
Firefox does not even make a conditional request on the CSS for each page
view. A conditional request is always made when the reload button is selected,
and an unconditional request is made when the reload button is Shift-clicked.
Note that the images from fetch.php (using the same headers) are conditionally
requested on every page view.

I think Firefox is optimizing the CSS (and JS) loading internally. While
this is a little odd, the result is not bad for us. On pages without images,
only two requests are typically made to the server: the page content, and
the indexer image.

To view Apache's log in real-time one can use something like
"tail -f /var/log/httpd/access_log". At least that's what works on my system.

Regards, Ben Coburn

------------------- silicodon.net -------------------

DokuWiki mailing list - more info at

Other related posts: