On 2014-02-20 2:50 PM, Bartosz Dziewoński wrote:
On Thu, 20 Feb 2014 23:21:37 +0100, Greg Grossmeier
<greg(a)wikimedia.org> wrote:
<quote name="Bartosz Dz."
date="2014-02-20" time="22:32:42 +0100">
It's worth noting that WMF branches also
include temporary hacks to
keep current JS/CSS and cached HTML output compatible (for at least 30
days), while release branches never contain them (and thus require
HTML caches to be purged during the upgrade process).
Isn't that:
> Feel free to base it off of either. There
shouldn't be any
> WMF-specific
> things in those wmfXX branches. If there is, it is a commit called
> something like "Commit of various WMF live hacks". That one commit can
> be safely reverted.
eg:
https://git.wikimedia.org/commit/mediawiki%2Fcore.git/a868d086b68f05e7f9372…
Nope, I mean different hacks (that people generally don't bother
ops/deployers with), like the ones being removed by
https://gerrit.wikimedia.org/r/#/c/61075/ or
https://gerrit.wikimedia.org/r/#/c/72151/ or
https://gerrit.wikimedia.org/r/#/c/102492/ or
https://gerrit.wikimedia.org/r/#/c/82102/ . They are required because
(to simplify) generated page HTML (which is cached for up to 30 days
on our cluster) includes links to "autoupdating" JS and CSS code. Thus
any JS/CSS changes need to be compatible with older generated HTML.
I've
thought for awhile that there are better ways to deal with the
cache than this.
My thought was a sort of snapshot feature for ResourceLoader:
https://www.mediawiki.org/wiki/User:Dantman/Code_Ideas#rl-snapshot
- We start outputting &version= on the load.php requests for skin resources.
- WMF runs a script that dumps the current state of just about all
modules into a snapshot folder.
- The MediaWiki upgrade is performed.
- Some configuration makes reference to the location of the snapshot.
- When load.php sees an old &version= it serves resources from the
snapshot instead of MediaWiki, this way even if the styles, scripts,
etc... have been modified, the module has been renamed, or even entirely
deleted the module is still served to old pages.
This way we don't have to create or revert any hacks at all, we are
unrestricted in the types of CSS/JS and HTML changes we make, and WMF
doesn't get any special treatment since now any wiki large enough to
have issues resetting its entire cache can take advantage of it.
~Daniel Friesen (Dantman, Nadir-Seen-Fire) [
http://danielfriesen.name/]