Overview
- Advantages of Website being served via CDN
- Important caveats of using a CDN
- How to configure CDN
- BunnyCDN
- CloudFlare CDN
- Improved Loading Speed: CDNs distribute your website's content across multiple servers located in various geographic locations. This reduces the physical distance between the user and the server, resulting in faster loading times. Users experience quicker page loads, leading to a more satisfying and engaging browsing experience.
- Enhanced User Experience: Faster loading speeds contribute to an overall improved user experience. Visitors are more likely to stay on your site, explore its content, and convert into customers or subscribers. Reduced latency and quicker access to images, videos, and other assets create a positive impression and encourage user retention.
- Global Reach and Scalability: CDNs have a network of servers strategically positioned around the world. This global presence allows your website to efficiently serve content to users regardless of their geographical location. Additionally, CDNs can scale to accommodate increased traffic, ensuring your website remains responsive and available even during traffic spikes or promotional events.
Caveats/Disadvantages of using a CDN
CDNs work by keeping a copy of your website's pages on their globally distributed servers. This has an important consequence - whenever you make any changes to your website (via your Vacation Labs Backoffice), it is not immediately visible on your storefront because it takes some time for the CDN to update its copy of that particular page.
We have partially solved this problem by implementing, what we call "automatic CDN cache-busting", where we issue a command to the CDN to refresh its copy of a particular page whenever we detect any changes made to that page. However, this is not 100% accurate because:
- Detecting changes in a page is not 100% accurate because each page is made of up dozens of components, each of which can be individually edited (eg. logo, menu, pictures, main content, related content, etc)
- CDNs take some time to react to the "cache busting" command, usually from 20 seconds up to 3 minutes.
Due to the CDN server delivery there might be an issue accessing the blog's admin area, for that please follow this support article -
Configuring your website to be served via CDN
Two CDN options are available:
- Bunny CDN (Paid but Vacation Labs will bear the cost)
- Can be configured by simply changing a CNAME entry
- Susceptible to certain DDoS attacks
- Integration available for for automatic cache busting
- Cloudflare CDN
- Entire nameserver (DNS management) needs to be moved to Cloudflare
- Industry leading DDoS protection
- Currently no integration with Vacation labs for automatic cache busting
Enabling Bunny CDN
In order to configure your website to be served via the BunnyCDN server you will need to reach out to the VL team and communicate that you want to enable the CDN Server as well as change the CNAME entry which you have made in your Domain's DNS panel, currently the CNAME entry will be something like
- Host/Host Name: www
- Value/Destination/Points to: sf.vacationlabs.com
This will need to changed to something like:
- Host/Host Name: www
- Value/Destination/Points to: vl-client-id-{{clientId}}..b-cdn.net
Please reach out to Vacation Labs at
support@vacationlabs.com to get the necessary value/destination for the CNAME Entry as well as ask them to move your website/enable the BunnyCDN server for your website
Configuring Cloudflare CDN
To enable Cloudflare CDN your domain nameservers will need to be changed to Cloudflare and all traffic will need to be proxied via Cloudflare. To do this please follow the steps below:
1. Login to cloudflare and click on Website and Add a site (refer screenshot below)
2. Type in the Domain name (example.com) and click on continue
3. Select the plan you want (there is a free plan available as well) and click on Continue
4 On the next page cloudflare will review your current DNS records on its own and you will need to move the cursor to orange side to enable proxying (refer screenshot)once done click on Continue
On the next page Cloudflare will give the Nameservers details that need to be configured in your Domain's DNS Settings (refer screenshot below)
Controlling what is cached in Cloudflare CDN
Controlling cache TTL in Cloudflare CDN
Cache TTL (Time To Live) is the duration for which cached data remains valid before it expires. It determines how long a cached copy of a resource can be served without needing to fetch a fresh version. Setting an appropriate Cache TTL is crucial for balancing website performance with content freshness, optimizing load times, and reducing server load.
On the Cache Rules section, remember to create a default rule which will set the default caching duration to 3-4 hours (as shown in the screenshot below)