[TYPO3-core] RFC: minify JavaScript

Dmitry Dulepov [typo3] dmitry at typo3.org
Tue Sep 11 12:50:44 CEST 2007


Hi

This is SVN patch request.

Branch: trunk

Problem: we can save lots of web traffic if we generate less spacey 
(spicy? ;)) JavaScript. For example, just a combination of blur and 
spam-protect scripts gives 400 bytes savings for each request. Yesterday 
I had approximately 600000 visits on one site yesterday, which gives 228 
megabytes of useless traffic! Of course it will be less dramatic with 
gzip enabled but still...

Solution: use JSMin library (Expat (MIT) license, compatible with GPL) 
to minify javascript. Catch errors and return unminified script if error 
happens. It is safe because JSMin was around for ages and used by many 
products nowadays. Result is cached, so no real impact on performance.

There are two patches: full (with JSMin in typo3/contrib/jsmin) and 
short (with only typo3 code). You can look at short only but you need to 
apply full patch. Add "config.minifyJS=1" to TS template and see the 
effect. This works also with

Requires PHP5.

-- 
Dmitry Dulepov
TYPO3 freelancer / TYPO3 core team member
Web: http://typo3bloke.net/
Skype: callto:liels_bugs
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: jsmin_mini.patch
Url: http://lists.netfielders.de/pipermail/typo3-team-core/attachments/20070911/a0e86410/attachment.txt 
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: jsmin.patch
Url: http://lists.netfielders.de/pipermail/typo3-team-core/attachments/20070911/a0e86410/attachment-0001.txt 


More information about the TYPO3-team-core mailing list