There are investigations for everything. Also for how the loading time of a website affects the possible bounce rate of the visitors. And it's hard to believe, but the bottom line is that the longer it takes a website to load, the higher the chance that the visitor will close the tab. Incredible.

So you should do everything possible to ensure that a website is delivered and, above all, displayed as quickly as possible. Apart from the fact that you should make sure that elements in the visible area are rendered first and certainly not flip back and forth while loading, another factor that can be easily influenced is keeping the number and the size of the required resources like stylesheets and JavaScript as small as possible.

The AssetCollector has been integrated with TYPO3 10.3. With this, scripts and stylesheets in Fluid files can be added to the rendering process with the ViewHelpers f:asset.script and f:asset.css. They behave similar to the renderAssetsForRequest already added in 8.6, with which you could render the corresponding code via the two Fluid sections HeaderAssets and FooterAssets.

The key difference is that, as the name suggests, the AssetCollector first collects the stylesheets and scripts and then only includes them once in the rendering. This means that I can reference the same JavaScript file in various Fluid files with the same name, which I need for example for a slider, but which is then only stored once in the document using a script tag at the end of the document.

Another advantage is that in this way you can ensure that only required resources are sent to the browser and not a JavaScript plugin for an accordion, which is not rendered on the page. Of course, this negates the concept that you always send the same resources to the browser so that it no longer requests them on the second page because it then takes them from its cache.

But with the simultaneous use of HTTP/2, which ensures that the resources for rendering the website are delivered to the browser before it even knows that it needs them, a speed advantage is still achieved in conjunction with the small data size and is especially noticeable in a faster rendering of the page. It is not at all bad that the resources are not integrated into the concatenation or compression process of TYPO3, as you were used to when you integrated your resources using TypoScript.

And so you have already made a few more visitors to your website happier.
And yes, I know, I have unfortunately not yet activated HTTP/2 on this page. It's not me. I'm sorry.

 

Comments

No Comments

Write comment

* These fields are required