While the recent changes to our Squid caching behavior mean more good
stuff stays in cache, improving performance, it's also made it harder to
clear bad stuff out of the cache.
One particularly irksome issue is "blank pages" -- when PHP dies due to
a bug or hitting a memory or time limit, you just get blank output. When
this comes before we've set our cache-control headers, the current Squid
settings mean that gets cached and shown to everybody else who comes to
that page.
This is rather troublesome for non-default actions and Special: pages,
since an ?action=purge won't help you -- you have to ask a developer to
log in and clear the URL manually. Ouch!
To combat this, I've added a default 'Cache-control: no-cache' header
into our local CommonSettings.php file, which comes early in code execution.
When everything goes ok, proper caching headers will override it... but
if the script dies partway through, that no-cache header gets sent out
along with the blank output, and the squids won't keep it.
The next refresh or the next visitor will be a new request, and a
transitory bug won't be stuck in cache.
-- brion vibber (brion @
wikimedia.org)