I've made some quick hacks to fall back to displaying cached pages where available when the database can't be connected to.
Change is in CVS and on the test wiki; you can simulate the database being down here: http://test.wikipedia.org/w/breakwiki.php
I've also pulled some of the caching stuff out of Article and into a separate CacheManager class; some more refactoring is likely warranted.
The new code dispenses as well with the duplicate uncompressed cache files when using gzip mode; a browser that doesn't support gzip-encoded pages should have the page fed to it uncompressed on the fly. This will significantly reduce space requirements for the cache at little CPU cost (most browsers do support gzip, and decoding gzip is relatively inexpensive).
Please test in various browsers!
-- brion vibber (brion @ pobox.com)
Brion-
I've made some quick hacks to fall back to displaying cached pages where available when the database can't be connected to.
Change is in CVS and on the test wiki; you can simulate the database being down here: http://test.wikipedia.org/w/breakwiki.php
Hmz, this only displays the Main Page for me, not the linked pages where I only get the "Sorry, the database is down" text but not the actual content.
On a related note, wouldn't it make sense to only cache the article body, so we can also use the cache for logged in users?
Regards,
Erik
Erik Moeller wrote:
Hmz, this only displays the Main Page for me, not the linked pages where I only get the "Sorry, the database is down" text but not the actual content.
Most pages on the test wiki aren't cached yet. Try any of these:
Anson_County%2C_North_Carolina Auto-TOC Aaron Be Ashland%2C_Kentucky Wikipedia%3AHelp Affirmative_action Albategnius Main_Page Talk%3AMain_Page Alabaster_Township%2C_Michigan Wikip%C3%A9dia%3AProjet%2C_Chronologie_du_monde%2Ftest3%2F101
Or visit a few others as an anon first.
On a related note, wouldn't it make sense to only cache the article body, so we can also use the cache for logged in users?
Could do, but there are still a lot of options that produce modified code. Some should be made more stylesheet-friendly, others we can simply detect and ignore for some users only.
We'd also lose the compression (which shaves about a quarter off our bandwidth usage IIRC) unless we kept both full-page and body-only copies (or compressed on the fly, which would use more CPU).
-- brion vibber (brion @ pobox.com)
"Brion Vibber" skribis:
I've made some quick hacks to fall back to displaying cached pages where available when the database can't be connected to.
Change is in CVS and on the test wiki; you can simulate the database being down here: http://test.wikipedia.org/w/breakwiki.php
What about a cached "Recent Changes"?
Paul
wikitech-l@lists.wikimedia.org