[Pmwiki-users] Suggestion for the sample-config.php
Patrick R. Michaud
Thu Mar 18 17:47:07 CST 2004
On Thu, Mar 18, 2004 at 11:07:48PM +0000, David Jackson wrote:
> Patrick R. Michaud wrote:
> >>Can I suggest that this info is put (commented) into the
> >>Or perhaps get a mention in the initial tasks page?
> >How about if I just add it to the standard default configuration, with an
> >option to set $EnableCompressedOutput=0 for those who don't want it?
> Sounds good to me. This is such a good tip, it should be standard.
In general I agree. OTOH, there are a couple of caveats--
1. It increases page "latency" -- i.e., the time between
when a user requests a page until they begin to see some text in their
browser. This is because ob_gzhandler waits until the entire page has
been generated before it begins to send (compressed) output back to the
browser. This probably won't matter much for small pages, but it may
make a difference in very large pages.
2. There's a small(?) potential for conflicts with other cookbook scripts.
Any scripts that make use of the ob_start(), ob_get_contents(), and ob_end()
functions might not work properly if ob_gzhandler is set.
The php.net site says that the preferred mechanism for producing
compressed output is to use the ini.zlib.compressed_output configuration
directive, which alleviates the latency issue (compressed output is
generated "on the fly"). Unfortunately, it doesn't appear to be possible
to enable this directive from within a PHP script--it has to be done from
a PHP configuration file or a .htaccess file.
> >Also, I'm currently experimenting with getting PmWiki to honor the
> >"If-Modified-Since" request header [...]
> I'll take your word on that. 404 is the only response I'm familiar with...
If the browser has a copy of a page in its cache, it's allowed to send
an "If-Modified-Since" header in its request. The server can then either
return a copy of the page (as normal), or if it knows that the page hasn't
changed it can send back "304 Not Modified" to tell the browser to use
its cached version. In this case the size of the transferred page
content is zero--a huge win for bandwidth and speed. :-)
> >Basically I'm looking to see if any browser caches get out of sync
> >with the true page contents after someone edits a page.
> Heh. How would we know ;-)
Well, if a page is edited in the Development group and you see the old
version (i.e., you have to hit reload to get the updated version), then
it's not working properly. I guess I'll probably have to enable the feature
for the whole pmichaud.com site and see if anyone notices anything.
Currently I have it designed as a cookbook module that is likely to be
integrated into the default PmWiki configuration in an upcoming release...
More information about the pmwiki-users