Page MenuHomePhabricator

Cache JS config vars in parser output
Closed, ResolvedPublic

Description

Currently, ViewEntityAction::show will call EntityView::registerJsConfigVars on every page view, causing considerable database load. This is really redundant, since the information generated there is already known when generating the HTML.

It would be good to put the JS config data into the ParserOutput along with the HTML, and then just transfer it to the OutputPage object (probably using a hook).


Version: unspecified
Severity: major
Whiteboard: backlog u=dev c=backend p=0
See Also:
https://bugzilla.wikimedia.org/show_bug.cgi?id=54215

Details

Reference
bz58340

Event Timeline

bzimport raised the priority of this task from to High.Nov 22 2014, 2:43 AM
bzimport set Reference to bz58340.
bzimport added a subscriber: Unknown Object (MLST).

Note: Iacd00a3aa implements something similar for bug 54215. The solutions of these two issues should be unified.

Change 89792 had a related patch set uploaded by Tobias Gritschacher:
Store EntityView js config in parser output

https://gerrit.wikimedia.org/r/89792

(In reply to comment #2)

bug 37501?

Related, but not required.

Bug 37501 asks for addJsConfigVars to be added to ParserOutput, analogous to OutputPage::addJsConfigVars. This would allow us to add the JS vars directly to the ParserOutput, from where they owuld get automatically transferred into the OutputPage.

We can however get the same effect by registering the desired information using ParserOutput::setExtensionData and then transferring it into the OutputPage later, using the OutputPageParserOutput hook, as done by the patch provided.

ParserOutput::addJsConfigVars was added with gerrit 108333

  • This bug has been marked as a duplicate of bug 54215 ***

Change 89792 merged by jenkins-bot:
Store EntityView js config in parser output

https://gerrit.wikimedia.org/r/89792