Hello,

This patch applies cache locking behaviour to stale cache entries, so
 in the case where the *_cache_lock directives are used, the same
 locking behaviour is used for stale content as it is for new entries.

Previously, this was only done for new cache entries.
(see: http://mailman.nginx.org/pipermail/nginx/2016-January/049734.html)

This is useful when serving stale content is not permissable but sending
 many requests upstream is undesriable.


This patch exposes the ngx_http_file_cache_lock function; this function
 is then called in ngx_http_upstream if a cache entry has expired.

I have attached two versions of this patch, a "minimal" one that avoids
 changes where not strictly necessary, and a "cleaner" version which is
 more invasive but (in my opinion) cleaner.

Both patches cause no (additional) failures in the nginx test suite.
I tested with as many modules as I could reasonably enable.

Additionally, a colleague will add tests for this new behaviour in a
 follow-up patch.


Regards, Elliot.



-----------------------------
http://www.bbc.co.uk
This e-mail (and any attachments) is confidential and
may contain personal views which are not the views of the BBC unless 
specifically stated.
If you have received it in
error, please delete it from your system.
Do not use, copy or disclose the
information in any way nor act in reliance on it and notify the sender
immediately.
Please note that the BBC monitors e-mails
sent or received.
Further communication will signify your consent to
this.
-----------------------------

Attachment: proxy-cache-lock-on-stale-cleaner.patch
Description: proxy-cache-lock-on-stale-cleaner.patch

Attachment: proxy-cache-lock-on-stale-minimal.patch
Description: proxy-cache-lock-on-stale-minimal.patch

_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel

Reply via email to