Snipcart Infrastructure Upgrade: New CDNMay 07, 2015
Being geeks at heart, we know performance is key at Snipcart. Up until recently, our static assets, such as JS files and images, were provided by our application servers. Since there was room for improvement there, we acted on it; we made the switch to a more performant infrastructure to serve our static assets.
Many developers we chatted with in the previous months showed interest regarding how we handle infrastructure. So today, I'll touch on the subject a little and discuss this new CDN of ours.
How our new CDN works
I'll start by showing you how our deployments and infrastructure work. Thanks to Bizspark, a cool MS startup program, we have a few Azure credits, so we decided to go all in with it. Also, most of our backend is written in .NET, so it was a natural fit for us.
To deploy our application, we use a pretty amazing service: AppVeyor. If you're a developer working in a .NET environment, you need to check them out. They run a continuous delivery service for Windows. To the best of my knowledge, they are the first ones doing it right for .NET developers. We used Jenkins before, which was also good, but had to be hosted somewhere. Since we're fans of handling everything directly in the cloud, we were more than happy when we found AppVeyor. We switched everything without looking back.
To give you a quick idea: when one of our developers pushes to our
On top of that, we are now using KeyCDN, which is a very nice Content Delivery Network (we basically created a Pull Zone over our blob storage on Azure). On each deployment, we purge our CDN cache, so you will not miss any updates due to cache persistency.
Making the switch: How it impacts you as a user
Even if our assets can still be served by our application at
app.snipcart.com, we strongly advise you to make the switch to the CDN. Assets will be served faster, every cache headers will be there so it will be optimized for your customers' browsers. And we know everybody likes a bit of speed in this digital age, right?
On your website, Snipcart requires two files to work,
snipcart.css. You should find something like this in your code:
You will need to change this to:
Same thing goes for the CSS file:
<link type="text/css" id="snipcart-theme" href="https://cdn.snipcart.com/themes/base/snipcart.css" rel="stylesheet" />
That's it; just swap
cdn.snipcart.com and you are ready to go!
I hope this little infrastructure upgrade will help you offer a great, optimized shopping experience for your customers. Again, we strongly encourage you to switch to the new CDN following the simple instructions in this post. If you have any questions regarding the new CDN or anything else, hit us up at firstname.lastname@example.org anytime.
Comments, feedback, suggestions? Feel free to leave a comment in the section below, friend!