[PATCH] Cache: provide naive feedback loop for uncacheable URLs

Piotr Sikora piotr at cloudflare.com
Tue Apr 28 22:03:10 UTC 2015

Hey Maxim,

> I'm not really sure this is a right change.

It is, without this change proxy_cache_lock basically serializes
access to the upstream.

> In particular, because "uncacheable" is a property of a response, not URLs.

That's nitpicking, but you're right, I should have used "cache key",
not "URL", but that only applies to the commit message and not the

Regarding the code, the "uncacheable" flag is only set for a
particular cache key after nginx receives uncacheable response for it
and it's only used to skip the cache lock on subsequent requests for
the same cache key, not to determine cacheability of the response.

Nothing changes when proxy_cache_lock isn't configured, nothing
changes for a cache key that didn't receive any response yet and
nothing changes for a cache key that received cacheable response.

What exactly isn't right?

Best regards,
Piotr Sikora

More information about the nginx-devel mailing list