Help Center/ Content Delivery Network/ FAQs/ Cache Settings/ Why Is the CDN Cache Hit Ratio Low?
Updated on 2024-10-16 GMT+08:00

Why Is the CDN Cache Hit Ratio Low?

Possible causes:

  • The HTTP header has been incorrectly configured. As a result, the content cannot be cached. Check the Cache-Control settings of your origin server. If cache-control is set to no-cache, no-store, max-age=0, or private on the origin server and Origin Cache Control is enabled on CDN, CDN cannot cache resources, resulting in a low hit ratio.
  • The cache TTL you have configured is too short. In this case, CDN PoPs will not be able to cache data. They will frequently pull the fresh content from the origin server. As a result, the CDN cache hit ratio will be low.
  • A large portion of the content on your origin server is dynamic. CDN mainly accelerates delivery of static content (such as CSS, JS, HTML, TXT files, pictures, and video). Dynamic content (such as ASP, JSP, PHP files, APIs, and dynamic interaction requests) is typically pulled from the origin server.
  • The cache is being refreshed too frequently. After a cache purge task is submitted, the cached content on CDN PoPs will be forced to expire. If a user accesses a URL after it has been refreshed, CDN pulls content from the origin server, and the hit ratio will decrease.
  • If your origin server has a large number of resources and does not support range requests, CDN PoPs will pull complete resources, increasing the pull traffic and affecting the traffic hit ratio.
  • The website is not accessed very frequently. Content cached on the CDN PoPs may be deleted due to infrequent access. As a result, the fresh content is pulled when it is accessed, and the CDN cache hit ratio will decrease.
  • An exception occurred on your origin server. In this case, troubleshoot your origin server first.
  • HEAD requests are sent. By default, CDN does not cache HEAD requests. Even if cache prefetch is performed, HEAD requests are not cached.