On Tue, Dec 10, 2013 at 4:22 PM, Daniel Kinzler <dan...@brightbyte.de> wrote: > > what is the intention behind the current implementation of > ParserCache::getOptionsKey()? It's based on the page ID only, not taking into > account any options.
Looking at the code, ParserCache::getOptionsKey() is used to get the memc key which has a list of parser option names actually used when parsing the page. So for example, if a page uses only math and thumbsize while being parsed, the value would be array( 'math', 'thumbsize' ). Then ParserOptions::optionsHash is used to construct a key corresponding to the actual ParserOptions object, for storing the actual parser output for that page+ParserOptions combination. In the example above, it would only use the 'math' and 'thumbsize' options to vary the key; users having the same 'math' and 'thumbsize' would get the same cached parser output even if they have different options for stubthreshold, dateformat, numberheadings, userlang, editsection, an so on. This reduces cache fragmentation. I doubt that the ContentHandler is really going to need to override getOptionsKey; the ParserOptions options used to parse the page really shouldn't vary depending on user language or other stuff like that. -- Brad Jorsch (Anomie) Software Engineer Wikimedia Foundation _______________________________________________ Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l