Rich-text Reply

Reducing weight of Project Code

Opsessed 10-29-14
Accepted Solution

Reducing weight of Project Code

Hello,

 

Recently I had the bright idea of trying to reduce the size of our Optimizely project code by minifying the Javascript of Experiments. I tried it for one - but the Project Code actually increased by a small amount. I didn't really expect that it would decrease much for one Experiment, but I didn't expect an increase.

 

Does anybody know if minifying Experiment javascript would ever reduce the size of "Project Code"

 

Thanks Smiley Happy

Level 2

greg 10-30-14
 

Re: Reducing weight of Project Code

I'm not sure why minifying would increase the code, but have you thought about creating multiple "projects" for your site just so all your experiments don't have to be in one script?
Level 2
Opsessed 10-30-14
 

Re: Reducing weight of Project Code

Hi Greg,

 

No I hadn't - that's an interesting idea. 

 

Thanks Smiley Happy

Level 2
adzeds 10-30-14
 

Re: Reducing weight of Project Code

Splitting your tests into separate projects is a great way of reducing the code in each.

Just make sure you have the right snippets included on the correct pages.

David Shaw
Level 11
Opsessed 10-30-14
 

Re: Reducing weight of Project Code

Thanks both for this suggestion - I'll keep it in mind for once the "Project Code" weight gets to a worrying level.

I've just found out that it's far from it now though - so I won't have to do it yet!

Cheers!
Level 2
Leanne 10-30-14
 

Re: Reducing weight of Project Code

If you are already loading jQuery on your page, then there is no need to load it in the Optimizely snippet. If you remove jQuery from the snippet, it will reduce the snippet size by a significant amount. Find more info here: https://help.optimizely.com/hc/en-us/articles/202480860#jquery_settings

 

Another suggestion is to archive all of the experiments that you are no longer using so the experiment logic is removed from the snippet. 

 

You typically only want to separate your experiements into different projects if they experiements belong to very different properties - ie a QA site vs production. Otherwise, it will be confusing and difficult to run experiments across your site due to different snippets. 

 

 

 

 

Level 2