RL: Avoid unnecessary and uncached requests for user and site modules
Closed, ResolvedPublic

Description

Simple fix for OutputPage::makeResourceLoaderLink

If a ResourceLoaderWikiModule (user or site) is empty, i.e. the relevant pages doesn't exist, there should be no link to it from the html to avoid unnecessary requests.

Currently, it doesn't only output the link, but also adds a version parameter with the current timestamp, which bypasses all caches. This is due to a bug in OutputPage::makeResourceLoaderLink, where the modifiedTimestamp of the module is rounded to 0 if it returns 1.

This bug occurs in the following circumstances:

  • For the site module, if MediaWiki:Common.js and MediaWiki:<Skin>.js is empty.
  • For the user css module, if not logged in.
  • For the user js module, if logged in and the user js pages are empty.

Simple fix attached.


Version: 1.18.x
Severity: normal
URL: http://translatewiki.net
See Also:
https://bugzilla.wikimedia.org/show_bug.cgi?id=63587

Attached: bug27302.patch

bzimport set Reference to bz27302.
P.Copp created this task.Via LegacyFeb 10 2011, 1:08 PM
Catrope added a comment.Via ConduitFeb 16 2011, 7:20 AM

Timestamp issue fixed in r82219.

Catrope added a comment.Via ConduitFeb 16 2011, 3:37 PM

(In reply to comment #1)

Timestamp issue fixed in r82219.

Wow, thanks for this report. It cut server load on the bits Apaches in half: http://file.status.net/i/identica/catrope-20110216T150241-xmvxh2t.png

MarkAHershberger added a comment.Via ConduitFeb 16 2011, 10:46 PM

Roan fixed this during the deploy.

Catrope added a comment.Via ConduitFeb 18 2011, 5:26 PM

(In reply to comment #3)

Roan fixed this during the deploy.

No I didn't, only part of it. The timestamp issue was fixed, but the loading of the user module for users with no user JS/CSS (and anons!) persists.

hashar added a comment.Via ConduitFeb 19 2011, 2:16 PM

Created attachment 8173
Attaching the picture to the bug for posterity.

Attached:

Catrope added a comment.Via ConduitFeb 19 2011, 5:08 PM

Fixed in r82468.

Add Comment