Upcoming SiteVision 5 and web performance

SiteVision 5 will make a giant leap in measurable performance.

Improved web performance metrics

Web sites built in SiteVision has always been very fast, but the performance has not always been reflected in performance measurement tools. Changes in the upcoming SiteVision 5 intends to change the latter. A lot of work has been done to up the scores and the overall experience of performance for users of all SiteVision web sites.

We have redesigned the structure of a typical SiteVision web page, moved all possible resources that block render to be loaded after first paint. We have also reduced the overall weight of resources, especially for web sites not using Social Collaboration.

Page structure

All third party javascripts and most of SiteVision javascripts have been removed from the HEAD-element. All external libraries will be loaded at the end of the BODY-element instead. This is best-practice for building high performance web pages. To further improve the end-users perception of performance we have consolidated and optimized CSS-resources, especially for web sites without Social Collaboration. This will minimize both the number of connections and the payload of data the browser needs to download.

Lazy load libraries

SiteVision modules that use large third party libraries now load the libraries on demand. A Library will be loaded only when a module depending on it is present on the current page. Some libraries will not be loaded until a certain function is activated by the user.

Lazy load images

The possibility to lazy load images below the fold has been added to the image module. When correctly used, this can dramatically decrease the loading times of large pages with a lot of images.

Result

All web sites built with SiteVision will see a dramatic increase of its score in performance measurement tools, right out of the box after upgrading to SiteVision 5. With some tinkering, especially on pages with a large number of images, even better results can easily be achieved.

Implications

All these changes comes with some implications that SiteVision developers must be aware of.

jQuery will be unavailable for direct access in inline javascripts!

All existing javascripts using the $svjq variable must be changed! jQuery will still be available for scripting, but all scripts using jQuery will have to be deferred to execute after the documentReady event. SiteVision introduces svDocReady - a utility to handle just that. Surround all inline javascript using jQuery with svDocReady and the result will be the same as before. More instructions and some tips 'n trix will be made available at a later time.

Since SiteVision now lazy-loads libraries for some of its modules. Custom functionality depending on libraries previously included by SiteVision might stop working. An example is jCrop which now only loads when a user actively uses the image crop functionality. Such functionality must be changed to actively load the library it needs.

SvDocReady to the rescue

As of version 4.5.4, SiteVision includes a utility named svDocReady. Inline scripts that needs jQuery or any other library included from the page, will have to be deferred via svDocReady. Deferring with svDocReady guarantees execution order and that SiteVision's third party libraries have been loaded before custom scripts are executed.

Prepare for SiteVision 5

Developers should start migration of inline javascripts after upgrading to SiteVision 4.5.4. This is highly recommended to ease the transition to SiteVision 5.

Do you want to subscribe to News from SiteVision Devloper team? Subscribe here!