[TYPO3-dev] Javascript Minify-Manager

ries van Twisk typo3 at rvt.dds.nl
Thu Mar 5 13:49:18 CET 2009


On Mar 5, 2009, at 7:37 AM, Dmitry Dulepov wrote:

> Hi!
>
> Sebastian Gebhard wrote:
>> Dmitry Dulepov schrieb:
>>> Firsts, minification feature is already implemented in TYPO3 4.2.
>>> Secondly, there is an extension that can minify/combine JS and CSS
>>> files together.
>> Where is it implemented? What's the extensions name?
>
> Hey, this is an easy search! ;)
>
> http://www.google.com/search?q=typo3%20minify%20javascript
> http://typo3.org/extensions/repository/? 
> tx_terfe_pi1[view]=search&no_cache=1&tx_terfe_pi1[sword]=script+merge
>
>>> The drawback of such things is that they happen at runtime, thus
>>> making the performance of the server worse. Minification of the
>>> JavaScript using PHP is extremely inefficient. When possible it  
>>> should
>>> be done separately before deploying the site.
>> Did you read my post fully? Maybe I did not make it clear enough  
>> but in
>> most cases with my approach the JS of a single page is only minified
>> ONCE and that file is used permanently until something is changed.
>
> Yes, I understood it. But even "once" is too much for me if the  
> script can be minified offline. For example PHP minification of one  
> ExtJS application that I wrote takes minutes. It takes 3 secs with a  
> command line version.
>
> It is not a problem to minify small scripts. But with small scripts  
> the effect is not that significant. With large scripts minification  
> at runtime becomes a major problem. Think what happens on a busy  
> site when a large script is changed. 100 people come, 100 requests  
> check and find that the file is modified, 100 requests start to  
> minify it, server is blocked.


With a bit of better scripting you could of-course block the operation  
for the other 99 users it sounds stupid for me that all 100 processes/ 
threads will minify the same JS up-on change. If that happens it more  
faulty code then anything else.

However minutes to compress a large JS is a long time though and even  
for PHP that doesn't sounds right and I would suspect that the PHP  
minify script is sub-optimal, command lien will always be faster...

Ries












More information about the TYPO3-dev mailing list