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 filesBy using the “curl” command that works on Linux and Unix/OS X the results would look as follows:
# curl -I static.examplesite.net/css/style.css
HTTP/1.1 200 OK
Date: Mon, 27 Aug 2012 00:06:33 GMT
Last-Modified: Fri, 24 Aug 2012 10:45:17 GMT
Expires: Tue, 28 Aug 2012 00:06:33 GMT