November 12, 2015
This tutorial assumes you have already created a pull zone.
Content Delivery Networks (CDNs) are usually used to cache files on their global networks to ensure fast file delivery to website viewers around the globe. The way a CDN works is, you request your files via the CDN URL, which calls the files cached/saved on the CDN server. If the file is found, it is delivered right away, if not, the CDN server will “Pull” the file from its origin location cache it, and deliver it.
Now, when setting your headers on your web server and preparing to send files to CDN for caching so you can speed up your website, which files do you need to cache, and which files do you not want to cache?
Cache-able files types:
- video (mp4, avi, flv, mpeg, m4v…)
- audio (mp3, flac,…)
- packages/installation packages (exe, bin, pkg.tar.xz, deb, rpm…)
- archives (zip, tar, bzip, bz2, gzip, gz, tar.gz, tgz…)
- text files (css, html/htm, js, woff, ttf, woff2, otf,…)
- images (png, jpg, gif, jpeg, …)
- documents (odf, xls, xlsx, doc, docx, ppt, pptx, xml,…)
Using Query String ( i.e: style.css?ver=123 ) is allowed.
Non-Cache-able (dynamic) files (and objects) types:
Note: It’s recommended to use push zones for files lager than 10MB (or somewhere around that number – there is no fixed limit).