MediaWiki r82468 - Code Review

Jump to: navigation, search
Revision:r82467‎ | r82468 (on ViewVC)‎ | r82469 >
Date:17:07, 19 February 2011
(bug 27302) Avoid unnecessary requests for user and site modules if the relevant wiki pages don't exist.

Done by adding isKnownEmpty() to ResourceLoaderModule and overriding it to check for page existence in ResourceLoaderWikiModule. Needed to rearrange some code in OutputPage::makeResourceLoaderLink() to have the emptiness check and dropping of modules work properly. Also factored the page_touched check in ResourceLoaderWikiModule::getModifiedTime() out to a separate method (getTitleMtimes()) and moved in-object caching there as well, so getModifiedTime() and isKnownEmpty() share code and caching for their timestamp/existence checks.

This does not account for the case where e.g. a user has user CSS but no user JS: I had implemented this by checking for $context->getOnly() in getTitleMtimes(), but then realized it's not safe to do this in a function called by getModifiedTime(): it causes the timestamp list in the startup module to only take scripts in account for wiki modules, because the startup module has &only=scripts set
Modified paths:

Diff [purge]

Loading diff…

Follow-up revisions

Rev.Commit summaryAuthorDate
r846131.17wmf1: MFT r81692, r82468, r83814, r83885, r83891, r83897, r83902, r83903,...catrope17:42, 23 March 2011
r85211MFT: r82297, r82307, r82309, r82312, r82315, r82337, r82391, r82392, r82403, ...demon21:01, 2 April 2011
r85342MFT r82465, r82468, r82474 (second try), followup to r85211demon17:05, 4 April 2011

Past revisions this follows-up on

Rev.Commit summaryAuthorDate
r82219(bug 27302) Don't append the current timestamp for user/site modules when no ...catrope07:19, 16 February 2011

Status & tagging log