Page MenuHomePhabricator

20kb project logo image requested on every page (betawiki.png)
Open, Needs TriagePublic

Description

As a followup from performance review (T254950):

"I've noticed a very minor thing when testing the site out for performance. There's a 20kb image that's requested on every page and never displayed: https://api.wikimedia.beta.wmflabs.org/static/images/project-logos/betawiki.png

I suppose it comes from some CSS (as the default site logo does), as I can't find it in the HTML. There's probably some other CSS from the skin to hide the original logo, but not in a way that stops it from loading."

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptWed, Oct 14, 5:16 PM

The root of the problem is that the MediaWiki is preloading the logo for the site, but the skin has a hard-coded logo and thus does not use the configured value. This is also evident through a warning message that appears in the console; for example, in my local install, I get the following:

The resource http://default.web.mw.localhost:8080/mediawiki/resources/assets/wiki.png?86a63 was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriate `as` value and it is preloaded intentionally.

The solution would have to be not hardcoding the logo in the skin or finding a way to convince MediaWiki not to preload the default configured logo.

Although this issue was identified in T254950#6532543 during the performance review of the WikimediaApiPortalOAuth extension, it is an issue in the WikimediaApiPortal skin.

Aklapper renamed this task from 20kb image requested on every page to 20kb project logo image requested on every page (betawiki.png).Sat, Oct 17, 4:54 PM

It is provided by ResourceLoaderSkinModule::getPreloadLinks. A solution could be extending that class and overriding getPreloadLinks to return an empty array.

It is also present in the skins MinervaNeue and Vector's Desktop Improvements (skin version 2), so a change to ResourceLoaderSkinModule might be a better way, such as making it an optional feature.

Change 634764 had a related patch set uploaded (by Cicalese; owner: Cicalese):
[mediawiki/skins/WikimediaApiPortal@master] Prevent preloading of logo.

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

Thank you for the suggestions, @Mainframe98. Very helpful! I opted to go with extending the class for now, which works great.

Change 634828 had a related patch set uploaded (by Cicalese; owner: Cicalese):
[mediawiki/core@master] Make logo preloading an optional feature.

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

The second patch is an alternative to the first taking the suggestion to make preloading an optional, default feature in ResourceLoaderSkinModule. Feedback on the patches, including which approach is preferred, is welcome.

Change 634833 had a related patch set uploaded (by Cicalese; owner: Cicalese):
[mediawiki/skins/WikimediaApiPortal@master] Make logo preloading an optional feature.

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