Low Cache Hit Percentage
- Purging the cache: When a Pull Zone’s cache is purged, the CHP will reset to 0%
- Not all files are cache-able: Some files might have a cache-control-header which will prevent our NginX servers from caching them. Some would be a “No-cache”, or a very low TTL.
- New files: When new files are added to CDN, this will affect the CHP and prevent it from reaching 100%
- Query String: A Query String is a little variable that suffixes a file, usually used to to identify a new version of the file for the browser to recognize it. If you are passing static files to us with a query string attached, we might actually be caching each file, but due to the dynamic query string, each request for the file generates a new cache file url, so the cached file is never actually served again. You can correct this by disabling the query string option in Pull Zone –> ‘Advanced Features’ in the control panel.
- Local Caching Mechanisms: When running a caching server, like Varnish, the Cache Control Headers set by Varnish will prevent the CDN from caching the files.
Identifying non-cache-able files
By using the “curl” command that works on Linux and Unix/OS X the results would look as follows:|
1 2 3 4 5 6 7 8 9 10 11 12 |
# curl -I static.examplesite.net/css/style.css HTTP/1.1 200 OK Date: Mon, 27 Aug 2012 00:06:33 GMT Content-Type: text/css Connection: keep-alive Last-Modified: Fri, 24 Aug 2012 10:45:17 GMT ETag: "1f37e38-89f0-4c800abf294a8" Vary: User-Agent Expires: Tue, 28 Aug 2012 00:06:33 GMT Cache-Control: max-age=86400 Server: NetDNA-cache/2.2 X-Cache: MISS |