[TYPO3-ect] general approach for JS

Steffen Kamper steffen at sk-typo3.de
Tue Sep 11 11:34:14 CEST 2007


Hi Franz,

"Franz Koch" <typo.removeformessage at fx-graefix.de> schrieb im Newsbeitrag 
news:mailman.1.1189497498.23803.typo3-team-extension-coordination at lists.netfielders.de...
> Hi guys,
>
>> while studying the Yahoo rules for speed optimization [1] (especially 
>> Rule #6) JS should be moved to the bottom.
>> I know that is not possible all the time, but the libs are included in 
>> TYPO3 in head. If i use extensions, i have no possibility to influence 
>> this.
>>
>> So i come to the conclusion, that the best thing would be a general 
>> JS-Collector Object. There all JS could be collected and rendered by 
>> pagegen-script.
>> My wishes for that would be
>> - categorization (include a lib/snippet, may be some standards for 
>> standard libs e.g. mootools, prototype etc.)
>> - configuration with TS to allow enable/disable including for some pages
>>
>> e.g. there is image lightbox, which includes prototype etc. It's only 
>> necessary on pages where pictures are defined as lightbox images, other 
>> pages don't need this inclusion.
>> there is ExtJS inclusion but is only needed on pages having ExtJS 
>> widgets.
>> etc...
>>
>> I will start a proof of concept for this and would be glad if you could 
>> write your ideas / proposals.
>
> sorry, but I thought that files like the CSS and JS inside the header get 
> cached by the browser if not changed since last time? So they wouldn't 
> "harm" included in the header after the first call to the page. But I'm 
> not sure how this is within TYPO3 and the sent headers.
>
> --
> Greetings,
> Franz

i didn't investigate the cache-mechanism at this point. If includes are in 
the body (or after the </body>) they schould be cached too by typo3,
the cache of the header depends on the expire-settings. I first try to 
follow the rules for optimization.
But this is also an important point to look at.

The main point of moving JS outside the head is to get faster render of the 
page, maybe it takes a little time after display for loading the JS.

vg Steffen 




More information about the TYPO3-team-extension-coordination mailing list