How does Nginx look-up cached resource?

Maxim Dounin mdounin at mdounin.ru
Thu Sep 10 16:59:09 UTC 2015


Hello!

On Thu, Sep 10, 2015 at 05:54:45PM +0200, Sergey Brester wrote:

> On 10.09.2015 17:33, Maxim Dounin wrote:
> 
> >On Thu, Sep 10, 2015 at 05:07:36PM +0200, Sergey Brester wrote:
> >
> >>Leave header format unchanged (I mean changes in header file
> >>'src/http/ngx_http_cache.h'), but not calculate and not compare crc32
> >>(unused / reserved up to "change cache header format next time")?
> >
> >Even that way resulting cache files will not be compatible with
> >older versions which do the check, thus breaking upgrades (when
> >cache items can be used by different versions simultaneously for a
> >short time) and, more importantly, downgrades (which sometimes
> >happen due to various reasons).
> 
> In this case (someone will downgrade back to previous nginx version) the
> cache entries will be invalidated by first use (because crc32 will not
> equal) - well I think it's not a great problem.

When cache entries are ignored due to incorrect crc32, this will 
result in an alert in logs.  Even if you are ok with invalidating 
such cache items (which isn't a good thing, either), unexpected 
alerts are certainly a bad thing and shouldn't happen.

-- 
Maxim Dounin
http://nginx.org/



More information about the nginx-devel mailing list