VWO Logo
Dashboard
Request Demo

Back to All Updates

Code Minification will now load VWO Campaigns Faster on your Website

Sathyajith Vijayakumar Sathyajith Vijayakumar 4 Min Read

The speed at which your website loads plays a vital role in keeping visitors engaged. The content that they would like to see should load up as quickly as possible and navigation between the different pages should be snappy. Additionally, it also makes your website more readily accessible to visitors on limited data plans or slower networks.

When a visitor comes to your website, the page is loaded on their browser by executing sets of code. When the amount of code is lesser, the browser is able to parse it quicker. This makes the page load faster. 

Code Minification is a process of reducing the code size of website and script files. This is done by removing characters in the code that do not play a direct role in its actual function. This bit of reduction in size helps pages load faster and goes a long way in improving user experience.

Why is Code Minification important?

When a campaign runs on your website, VWO’s code for the campaign needs to execute to show a variation to the visitor. Readability is generally preferred when code is created. Code structured with adequate spaces along with descriptive variable names and comments are common during development. The downside to such a convenience is the browser needing to parse these additional characters when they do not functionally contribute to the code; meaning- these can be ‘minified’. Minified versions of code have more compact file sizes and will deliver the same website experience to your visitor. The reduced network demand without these unnecessary characters enables pages to load faster.

Minification is different from compression, where the code within the file is completely rewritten. Once compressed, the file then needs to be decompressed first in order to read it. Minification can reduce file size even before compression, by reducing the content in it to make it leaner and more light-weight. Minification combined with compression results in even higher savings in payload size.

You can see the difference before and after minification in the following example. A developer would normally write unminified Javascript code like so:

Image3
An example of an Unminified Javascript code

This minifies into a single line of code like so:

Image1
Minified version of the same code

When a VWO campaign runs on your website, be it for Testing changes or to Deploy them, changes get applied on the page by executing Javascript and CSS code when the page loads. You can create a campaign variation by 

  1. Directly coding changes using the Code Editor
  2. Defining changes visually using Visual Editor. The code will be generated by VWO based on the changes defined.

With this update, VWO will now automatically minify the campaign’s code when it runs on your website . Your code can be as descriptive as you want it to be with no impact on loading times of the page. The Unminified code entered by your will remain as it is, VWO will only minify the code when the campaign is served to your website visitors. Campaigns created by the Visual Editor have also seen to benefit by shedding as much as 50% of its size in some cases.

Code Minification is enabled by default in your account, and it is highly recommended that you leave it enabled for all your campaigns. If you still wish to disable Minification, you can do so:

  1. In the Code Editor by going to Settings > Minify Javascript/JSS code
Image4
Minify code option in the Code Editor

2. In the Visual Editor by going to Edit code > Settings > Minify Javascript/CSS code

Image2
Minify code option in the Visual Editor

To know about Code Minification in more detail, do check out this article. It also explains how it is different from file compression.

Products
VWO Platform
Plans
Growth, Pro, Enterprise, All
Tags
Performance
For questions/concerns
support@vwo.com
Share

Subscribe for VWO Product Updates

Be the first to know. Stay on top of the latest VWO features and releases. You will also be invited to try our exciting beta features in the works!

A value for this field is required.

Thank you!

Check your inbox for the confirmation mail