0

Fleet of Apache 2.4 reverse proxies on an AWS EC2 instance, directed to cache to an ElastiCache memcache cluster. Pretty typical stuff.

The CacheDetailHeader directive is on, and regularly sends the value "cache miss: cache unwilling to store response" from hostname.my.domain which is unusually resistant to Google searches.

I've verified connectivity between the instances and the cache cluster, and I can watch periodic "stats" interactions between an instance and the cluster, which seem successful. I can interact with the server over telnet, so that part's solid.

Thing is, the Apache server rarely even tries to "set" a value, which makes me think Apache's "willingness" to store a response is the problem.

A typical subset of response header from the upstream is like this for and HTTPS request of random-image.png

Cache-Control: public
Cache-Control: max-age=31535000
ETag: "*(a value)*"
Expires: Tue, 27 Nov 2018 18:38:04 GMT   *(24 hours from now)*

No Set-Cookie, no request headers that might prevent a cache.

Ultimately the question is this: what else could persuade Apache to be "unwilling" to cache?

1 Answer 1

0

The headers are either going to be sent from apache if you have configured specific values for file types or from your backend either in code or from the backend HTTP server. Those cache control headers would appear to be defaults, which would suggest nothing is being explicitly set. What is delivering the content? I have to admit I had to look up mod_cache_socache but it wouldn't appear to set headers at all.

Having a look at 'willingness', documentation suggests that it may be related to your backend not providing modification dates or hashes or other indicators of freshness. Also don't get confused with the front end headers and the cache content. Without knowing much more my guess would be that you need a bit of granularity in your caching rules and in your front end header rules.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.