[TYPO3-core] RFC: minify JavaScript

Dmitry Dulepov [typo3] dmitry at typo3.org
Tue Sep 18 09:06:27 CEST 2007


Hi!

Benjamin Mack wrote:
> But: Aren't there other packager / compressor for JS that can compress 
> the scripts more, stronger & better? (dunno)

There is yahoo package but it is written in Java and must be called offline. There are some web-based packages without source code. JSMin was around for a long time, it is stable and good written and it has compatible license. It is used by ExtJS framework, which is very complex but JSMin works great for it, which says about its quality. So I decided to use it :) May be it gives less compressions than other tools but there will be no side effects. Many tools replace variables with $_1, $_2, etc., which may cause problems if inline script refers to these variables. So JSMin is safest but yet effective for us.

> Also it would be cool to have a classic cache system for this in the 
> Backend like:
> 
> template.php: includeJSFile("typo3/tree.js");

Actually, it was you who gave idea about minifying JS on typo3 ;) It was your tree patch. I thought that we can go futher in optimization and minify JS to decrease downlodable sizes even more. So partically credits for my patch go to you ;) I thought that first we introduce minification as such to core (as you see I still have only one +1, so it is hard enough) and than we can move almost every BE script to external file, minify them automatically and possibly even add more _.htaccess for client-based caching. I found in FireBug that if script is cached on client side, it takes 16ms to load and parse and starting from 235 ms if I have to load it from server. And this is a very high-speed connection to a server near me (4 Internet hops or so).

-- 
Dmitry Dulepov
TYPO3 freelancer / TYPO3 core team member
Web: http://typo3bloke.net/
Skype: callto:liels_bugs


More information about the TYPO3-team-core mailing list