Last modified: 2010-10-18 17:31:15 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T21995, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 19995 - Don't link to empty css
Don't link to empty css
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
Parser (Other open bugs)
1.16.x
All All
: Normal enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
: patch
Depends on:
Blocks: 24415
  Show dependency treegraph
 
Reported: 2009-07-29 19:36 UTC by Platonides
Modified: 2010-10-18 17:31 UTC (History)
5 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments
Don't-link-empty-css.patch (1.20 KB, patch)
2009-07-29 19:37 UTC, Platonides
Details

Description Platonides 2009-07-29 19:36:38 UTC
A default mediawiki install will link with every page load up to four 'empty' php-generated css files (Common.css, Print.css, skin.css, User/skin.css), plus a fifth (Handheld.css) disabled behind $wgHandheldStyle.

While small and easily cacheable, they produce a innecessary request on first visit and rendering lag.
The attached patch skip -at the cost of a regex (compiled once, executed three times)- linking to the three that are already in the message cache.

Unless the extra db query discourage it I'd also skip non-existant pages for the user css subpages.

Users viewing cached pages won't view the changes immediatly once the css is created, which is similar to the existing situation where the css page will be cached. If there's a caching proxy, pages served from it previous to the page creation won't serve the css. If it's really needed to show it immediatly, the sysadmin could purge its cache or add a configuration option, but I don't think such case would be common enough to make that necessary.
Comment 1 Platonides 2009-07-29 19:37:19 UTC
Created attachment 6398 [details]
Don't-link-empty-css.patch
Comment 2 Brion Vibber 2009-07-30 16:51:52 UTC
Hmmm...

I wonder if it's better to just consolidate them. Michael, can this already be done with script-loader goodies?
Comment 3 Michael Dale 2009-07-30 18:26:15 UTC
I never got around to merging in the style sheet grouper. Its a bit complicated since there are conditional includes (print css, IE css etc) and the paths to images have to be rewritten... and it hurts catch-ability to group everything for every context. Ie you have a base style sheet and that is cached it sucks to get a new file that includes that main style sheet when your on a different page. 

But there issues can be overcome. (we do separate requests for "core" scripts and page specific scripts with the script loader javascript for example)

I don't have a good sense if this is high priority though. Probably would not take too long... I will put it on my medium priority todo list ... unless its critical for deployment; then I will put it on high priority ;)  
Comment 4 Brion Vibber 2009-07-30 18:28:11 UTC
Not supercritical, though it doesn't hurt to trim unnecessary reqs. :)
Comment 5 Chad H. 2010-09-01 14:05:17 UTC
Pinging this again.

Roan, is this being taken care of in the resourceloader branch?
Comment 6 Platonides 2010-09-01 22:13:56 UTC
Empty user javscripts are not linked since r68065
Comment 7 Sam Reed (reedy) 2010-09-01 22:16:03 UTC
<RoanKattouw> Reedy: Empty CSS? Well it gets combined, you know, so it doesn't matter
Comment 8 Roan Kattouw 2010-10-18 17:31:15 UTC
Fixed in ResourceLoader by combining CSS files.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links