Important Note

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.

The question is: “What types of file I can cache on CDN?” Technically, you can cache any type of file on CDN. But realistically, CDN should be used to cache static files only. Static files are images, text files, stylesheets, html files, and so on. All files have headers; headers are lines of data that identify the file type, size, compression, expiry etc… our CDN honors these headers of files when files are sent to CDN. To CDN, all files are “static”.

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:

  • asp
  • cfm
  • dhtml
  • jsp
  • php
  • cookies
  • folders/directories

Note: It’s recommended to use push zones for files lager than 10MB (or somewhere around that number – there is no fixed limit).

  • so how can i set my site up to push all of my zip files to the cdn? im using wp rocket