Why may I be getting a poor cache-hit ratio?


There are a few things to initially check that may contribute to a poor cache-hit ratio:

1. Headers

Fastly will by default bypass content with a Set-Cookie, Cache-Control: private, or Cache-Control: max-age =0 header.

If your origin isn’t sending Cache-Control, Surrogate-Control, or Expires headers, check if your Default TTL ( Under Settings/Default Settings) is set to zero.

You can test a url with the following command to see headers sent with a request:

curl -svo /dev/null "http://www.example.com/main.html"

**2. Request Settings (Under Settings/Request Settings) **

Do you have Request Settings rule with an action of Pass? If so, does this rule affect a good amount of traffic?

3. Cache Settings (Under Settings/Cache Settings)

Did you create a Cache Setting rule with an action of Pass? Similar to Request Settings, does this rule affect a good amount of traffic?

**4. Caching TTL **

The cache-hit ratio is defined as the proportion of cache hits vs. all cacheable content (hits + misses). Are you Cache-Control or Cache Settings TTLs very low? The effect may not be big but improving your cache-hit ratio as much as possible will help improve your overall performance.

Lastly, I want to mention an awesome tool to use with Fastly for future debugging- Remote Log Streaming. Take a look at our help document for guidance in setup: http://docs.fastly.com/guides/22951283/21713181