Follow

Using the Distil CDN to Accelerate Your Site

In addition to Content Protection, the Distil Public Cloud offers the value add of a simple but effective content caching service, the Distil Networks CDN.

Understanding the Distil Networks CDN

The Distil CDN operates as a cache-on-hit proxy. When enabled, for static or dynamic content, Distil will cache objects based on the set caching headers. If caching is enabled, but no caching headers are set on the content, Distil will cache content based upon the settings you have configured in the Distil Portal.

 

Cache Busting Headers

If any of the following headers are present on your pages or resources, be sure to set their value to allow for the Distil CDN to properly cache those pages or resources. These headers will always be respected, irregardless of what other headers may be set or what your Content Distribution settings are configured in the Distil Portal.

Expires

The easiest to use caching header has to be Expires. If none of the other headers are set, this header says whatever receives this asset can hold onto it for this many seconds or, if the value is a timestamp, then it can be held until this point in time. If you view the headers of your webpage and you see just “Expires: 360” this means that a customer’s PC, the Distil CDN, or any other CDN can cache this page for 360 seconds. On the flipside, if Expires is set to 0 or a date in the past, this means that this page is uncacheable.

Set-Cookie

If you view your websites’ headers and you see “Set-Cookie”, you’re viewing a page that Distil won’t cache. The reason for this is simple, when most websites are looking to set a cookie, they’re looking to set a cookie for one user and one user only. If we allowed this header to be cached, we risk causing issues for any of our customers who have login systems or have in-page tracking cookies set by the HTML document itself.

Cache-Control

Cache-Control is easily the most powerful of all the caching headers. As the HTTP specification outlines (here) this header gives users full control of how and where their content can be cached. As a general rule, if you’re trying to use Distil as a CDN, then a Cache-Control with a value of “private”, “no-cache,” “no-store,” “max-age: 0,” or “s-maxage: 0” then Distil will be unable to cache the page. To get to a point where Distil can cache the page, you’ll want the Cache-Control header to set to “public.”

Mobile Site Caching

When you enable Distil’s mobile cache, you are both activating a second keyspace for content caching and enabling Distil's mobile browser detection. Doing so will ensure that mobile visitors are being served the mobile version of your site. This is required if you enable caching on a domain where a separate mobile sites pages are served from URLs common to both the mobile and desktop sites.

Considerations

Make sure your cache headers are set to prevent caching of pages that are only for logged in users.

Using Last-Modified may not work as expected--consult with Distil support for more information.

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

Comments