NetDNA’s System honors all the Cache Control Headers sent from the Origin Pull location. Low Cache Hit Percentage usually means that static assets, while being served via CDN, not all of them are cached. The Cache Hit Percentage [Thereafter referred to as CHP], starts every day from 0% and builds up during the day until it reaches its maximum. With a perfect CDN Integration, the CHP will be 100% by the end of the day, or even before that. However, it is worth mentioning that there are some things that will cause CHP to not increase:
  1. Purging the cache: When a Pull Zone’s cache is purged, the CHP will reset to 0%
  2. 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.
  3. New files: When new files are added to CDN, this will affect the CHP and prevent it from reaching 100%
  4. 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.
  5. 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: The X-Cache: MISS indicates that the file is being pulled from the origin when requested. The same result can be achieved by using the file path in the Cache Inspector.

Resolving the Low CHP problem

The simplest way to avoid Low CHP, is to avoid all the contributing factors previously mentioned. If you already have, and you still get Low CHP, contact NetDNA’s Support Team for assistance.