Can't get a simple proxy to cache anything
mdounin at mdounin.ru
Sat Jan 23 15:14:47 UTC 2021
On Fri, Jan 22, 2021 at 04:47:07PM +0000, Phil Endecott wrote:
> So the proxy has successfully retrieved the file - but it has not been cached;
> there is nothing saved in /var/cache/nginx.
> Looking in the nginx debug log, I see this:
> 2021/01/22 16:25:38 [debug] 18695#18695: *18 http cacheable: 0
> So my guess is that something about the http request or response, or
> in the nginx configuration, has caused nginx to decide that this response
> is not cacheable.
> Can anyone see what the problem is?
You haven't configured any proxy_cache_valid directives (see
http://nginx.org/r/proxy_cache_valid for details), and the
response doesn't have any cache validity headers, such as
"Expires" or "Cache-Control: max-age=...".
More information about the nginx