For example, a snippet file is http://cdn.optimizely.com/js/xyz.js
Should I download the xyz.js file, and then put the file on my own web server for web page to load, instead of the remote file in cdn?
You will find that you constantly have to keep updating the file on your CDN every time you make a change.
There is no real performance issue with loading the snippet from the Optimizely CDN.
David has nailed it.
In general there is no real benefit to self-hosting our snippet and additionally you would need to download the snippet from Optimizely and update the self-hosted snippet file every time you change the settings for your project or make changes to an experiment.
If you've any concerns about snippet performance, feel free to let us know so we can put your mind at ease!
Well seems casper.com hosted the file themselves and it shaved off 1.7 seconds on page load time so seems there is value.
The 1.7s mentioned in the article includes changes other than just "self hosting".
They also did not mention if they used preconnect and prefetch tags to help move these handshakes earlier.
Isolating the "self hosted" pieces from the data they provided, it looks like ~400ms were saved by self hosting.
The other improvements resulted from other changes.
If 0.4s on first-page-hit is important to you (e.g., we cache ours for 15 minutes, so the user only fetches it once every 15 minutes - typically their very first page hit of their session), then self-hosting may be worthwhile to pursue.
Analytics and Testing Guru