Last modified: 2012-03-01 22:01:38 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 T31921, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 29921 - Loading a page with ResourceLoader takes more time than without that
Loading a page with ResourceLoader takes more time than without that
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
ResourceLoader (Other open bugs)
1.17.x
All All
: Normal major (vote)
: ---
Assigned To: Trevor Parscal
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-07-16 11:56 UTC by Szőts Ákos
Modified: 2012-03-01 22:01 UTC (History)
4 users (show)

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


Attachments
Firebug showing JS files (35.28 KB, image/png)
2011-07-23 07:06 UTC, Szőts Ákos
Details

Description Szőts Ákos 2011-07-16 11:56:23 UTC
I've just upgraded to MediaWiki 1.17 and also updated my skin file to use ResourceLoader.
But the problem is with ResourceLoader, that my site is loading from 8 secs to 2 mins… Before it took approximately 4-5 seconds.

After I investigated the issue, I found out, that RL doesn't cache the generated minimized files, rather than it let a proxy to cache it for own purpose.

It's very bad, because for a slow server (typical at hosting providers) every page generation takes a lot of time to generate to all users a dedicated JS and CSS file (which are mostly the same).

For example phpBB stores its generated cache in the database. Wordpress with "W3 Total Cache" extension stores every minimized files on the file system after the first visitor had that generated (and even automatically stores that on a CDN).

After I disabled the RL and removed it from my skin, the site loads again in 2 seconds.

Here is a thread on it:
http://lists.wikimedia.org/pipermail/mediawiki-l/2011-July/037638.html
Comment 1 Roan Kattouw 2011-07-18 17:04:54 UTC
(In reply to comment #0)
> I've just upgraded to MediaWiki 1.17 and also updated my skin file to use
> ResourceLoader.
> But the problem is with ResourceLoader, that my site is loading from 8 secs to
> 2 mins… Before it took approximately 4-5 seconds.
> 
> After I investigated the issue, I found out, that RL doesn't cache the
> generated minimized files, rather than it let a proxy to cache it for own
> purpose.
> 
It does cache it. If you have $wgCacheType = CACHE_DB; set (or CACHE_ACCEL if you use APC, or CACHE_MEMCACHED if you use memcached), it should cache it there. But if it's set to CACHE_NONE, it'll have nowhere to cache it.
Comment 2 Mark A. Hershberger 2011-07-18 19:14:05 UTC
szotsaki, what is wgCacheType set to in your LocalSettings?
Comment 3 Szőts Ákos 2011-07-21 18:47:22 UTC
This variable had no occurrence in my LocalSetttings.php, but I var_dump'ed it. PHP for this command `die( var_dump( $wgCacheType ));` replied: NULL.
Comment 4 Roan Kattouw 2011-07-21 20:48:00 UTC
I'm sorry, I meant $wgMainCacheType.
Comment 6 Szőts Ákos 2011-07-23 07:06:49 UTC
Created attachment 8817 [details]
Firebug showing JS files

Thank you for the tip; it was on CACHE_NONE. I set it to CACHE_DBA and now the .dba file is growing nicely.

The situation is much better now, but unfortunately far from perfect. The specific site in my case is http://www.morrohun.hu/esl .

As you can see in the attached picture, three JavaScript files load one after another, taking almost three seconds while blocking everything else.

And while loading the HTML content there's no CSS file in the beginning (because it's still loading), that's why the browser shows a bare, white page for some seconds.
Comment 7 Subfader 2011-07-23 13:31:28 UTC
^^That's extreme. In your header only the shared and print.css is loaded? It misses the skin's main.css 

<link rel="stylesheet" href="/esl/load.php?debug=false&amp;lang=hu&amp;modules=mediawiki.legacy.commonPrint%2Cshared&amp;only=styles&amp;skin=morrohunv2&amp;*" />


That's my header output for rel="stylesheet":

<link rel="stylesheet" href="/wiki/load.php?debug=true&amp;lang=en&amp;modules=mediawiki.legacy.commonPrint&amp;only=styles&amp;skin=monobook&amp;*" />
<link rel="stylesheet" href="/wiki/load.php?debug=true&amp;lang=en&amp;modules=mediawiki.legacy.shared&amp;only=styles&amp;skin=monobook&amp;*" />
<link rel="stylesheet" href="/wiki/skins/monobook/main.css?404" media="screen" />

My problem is that I hide some elements via Common.css and dispaly them to certain users via user scripts. But with RL those are loaded at the bottom which makes some elements appear at the end of all DOM building.
Comment 8 Roan Kattouw 2011-07-25 18:28:04 UTC
(In reply to comment #5)
> YSlow* reports that RL components are not gzipped:
> 
> Not always but e.g. on http://www.mediawiki.org/wiki/Special:Watchlist
> 
> Grade F on Compress components with gzip
> 
> There are 11 plain text components that should be sent compressed
> 
Using FF5, visiting [[mw:Special:Watchlist]] via the secure gateway, I do see Content-Encoding: gzip on the load.php requests. So this works for me.
Comment 9 Subfader 2011-07-25 18:55:19 UTC
as said, it works sometimes, sometimes not. try more pages please.
Comment 10 Szőts Ákos 2011-07-25 19:18:32 UTC
Yes, most of the skin files are in the extension (ext.MorroHun). Mostly, because I found little documentation about the migration (I swear, I read all of the articles). That's why MW has to load the normal load.php with CSS, which I think is by factory included, and also a version of mine which contains all of the necessary CSS rules.

Documentation is really a big problem, I think, because I have no clue, how can I disable the deprecated wikibits.js and others; how can I reach my own JS functions (only related page I found is: https://secure.wikimedia.org/wikipedia/mediawiki/wiki/Talk:ResourceLoader/Using_with_extensions ). But this is an other issue; not related to this bug.
Comment 11 Szőts Ákos 2011-08-21 12:16:47 UTC
I think, I've found the major cause of this. There was a bug (Bug 262074) which caused the extension "load.php files" didn't get the proper &version parameter, thus somehow MediaWiki 1.17 always regenerated that.

I applied the two fixes mentioned in the report and now, it appeals me much more :)

Here are the two patches:
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/80167
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/81689

Btw. according to the roadmap, 1.18 will be here in a half month, and that will contain the fix.

Could you please test it?
Comment 12 Roan Kattouw 2011-08-21 13:10:51 UTC
(In reply to comment #11)
> Here are the two patches:
> http://www.mediawiki.org/wiki/Special:Code/MediaWiki/80167
> http://www.mediawiki.org/wiki/Special:Code/MediaWiki/81689
> 
Yeah, I remember those. They were merged to 1.17wmf1, but I guess they were never merged to 1.17 then.

1.18 should be out relatively soon, yeah.
Comment 13 Max Semenik 2011-08-21 17:40:56 UTC
> Yeah, I remember those. They were merged to 1.17wmf1, but I guess they were
> never merged to 1.17 then.
> 
> 1.18 should be out relatively soon, yeah.

Still, it would be great if we backported them to 1.17 cause we probably need a bugfix release already.

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


Navigation
Links