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:
[box type="info"]Using Query String ( i.e: style.css?ver=123 ) is allowed.[/box]
- bz2 / bzip
- css / css?query_strings_are_ok
- doc / docx
- html / htm
- jpg / jpeg
- js / js?query_strings_are_ok
- ppt / pptx
- tar.gz / tgz / gz
- xls / xlsx
Non-Cache-able files types:
the CDN has a limit of 10MB per single file on Pull Zones.