The widget itself only has a slight effect on the total loading time of a page. The main cause of any lag is due to the YouTube code, which affects the loading time even if videos are embedded directly to a product page, instead of the widget.
Bundle size
We keep an eye on the size of the widget and review its dependencies to keep it clean of redundant modules. Some of the widget functionality is only available as extensions, which means that it’s not included by default, to avoid you receiving anything superfluous. We support gzip and brotli compression methods for the widget to make sure that data transfer is as fast as it can be.
Non-blocking rendering
Our widget doesn’t block the rendering of your page. It loads asynchronously and starts working as soon as the page is ready to work with it.
Low-demand operations
- The widget reads the page (DOM) using pre-defined, direct, and unambiguous selectors (querySelector or XPath).
- The widget only hails our server to request videos for a product and attach click-listeners to the add-to-cart button if it finds product-related data points.
- The visual part of the widget is only rendered if videos exist for a product.
Changing when the player loads
If you feel your loading time is not optimal, you can choose the faster option of loading the YouTube player inside the Videoly widget. There are currently three options available:
Default - the YouTube player is preloaded for every product page that currently has a Videoly widget
Every product page with the video - the YouTube player is preloaded for every product page which contains content from Videoly at the moment of rendering the widget
After click - the YouTube player starts loading only when a user clicks on the Videoly widget's thumbnail
If you have any further questions about this, please get in touch with us at support@videoly.co :)