Last modified: 2011-03-13 18:05:48 UTC

Wikimedia Bugzilla is closed!

Wikimedia has migrated from Bugzilla to Phabricator. Bug reports should be created and updated in Wikimedia Phabricator instead. Please create an account in Phabricator and add your Bugzilla email address to it.
Wikimedia Bugzilla is read-only. If you try to edit or create any bug report in Bugzilla you will be shown an intentional error message.
In order to access the Phabricator task corresponding to a Bugzilla report, just remove "static-" from its URL.
You could still run searches in Bugzilla or access your list of votes but bug reports will obviously not be up-to-date in Bugzilla.
Bug 12250 - compress ("minify"/obfuscate) javascript output
compress ("minify"/obfuscate) javascript output
Product: MediaWiki
Classification: Unclassified
Parser (Other open bugs)
All All
: Lowest enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
Depends on:
  Show dependency treegraph
Reported: 2007-12-08 23:43 UTC by italvet
Modified: 2011-03-13 18:05 UTC (History)
3 users (show)

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


Description italvet 2007-12-08 23:43:14 UTC

i'm actually working on local javascripts, trying to make them like a "formal garden"

so i remove useless bits of code, optimise them and so on, in the purpose of makig them lightest possible, and then less heavy for the servers (i think that every single byte is significant in the common.js, the monobook.css of big projects).

but i also write documentation for the functions i optimise... so the weight i loss in the code optimisation i gain it back because of the comments

so i wonder if it should be possible that the software strip the comments in the stylesheets and javascripts before sending them to the clients.

the full scripts page should remain intact with direct request on them of course.

i think that this feature will save a huge amount of money for wikimedia.

Kind regards
Comment 1 italvet 2007-12-09 15:38:48 UTC
and besides this money consideration, it should be a nice feature
Comment 2 Tim Starling 2007-12-09 15:49:19 UTC
I'm against this. In my experience, the savings from javascript compressors post-gzip are so small that you could only justify it on the grounds of obfuscation. Obfuscation is not what we're about. These files are cached on the client side so typically sent to the user once per visit. 

If you want something to optimise, try the 51KB of edit tools we send out every time someone clicks a red link (over 100KB on commons). 
Comment 3 AlexSm 2007-12-11 17:52:09 UTC
I remember at least 3 proposals on en.wp to replace Edittools with JavaScript. There was no opposition, but none of the admins was brave enough to actually implement this (sorry for offtopic).
Comment 4 Aryeh Gregor (not reading bugmail, please e-mail directly) 2007-12-18 18:30:48 UTC
I agree with Tim.  We already compress it, using gzip.  The benefits of any further compression are outweighed by the annoyance of anyone who actually wants to read the stuff.
Comment 5 Christian Neubauer 2008-03-25 17:01:36 UTC
According to YSlow (, a number of JS files from commons are not gzip'd.  Try editing a page on commons in Firefox and take a look at the response headers of wikibits.js for example.  YSlow also complains that the commons logo doesn't have an expires header.  There's probably a good reason for that that's beyond me.
Comment 6 Brion Vibber 2008-03-25 17:14:38 UTC
Raw files are not currently compressed as they are served directly by the web server, which we have not currently configured to compress them (though we plan to do so).

Any JS served directly out of the wiki gets compressed.

This feature request though was about *obfuscation* for the purposes of making the files smaller; that's something we'll reject regardless of the use or non-use of gzip compression, as it makes debugging and customization much more difficult.

I've updated the summary to clarify.

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