At Gitpod, we would like to use this great plugin to use cached entries in case the upstream server answers with an HTTP status code >= 500 (server error). This is similar to the proxy_cache_use_stale option of nginx (see nginx docs).
This PR adds a new config option stale_max_age with a default of 0. If this value is > 0, this duration is added to the expiration time. That means entries are kept in the cache for this time after they have already expired. When the upstream server answers with an HTTP status code >= 500 (server error) this plugin checks whether there is still an expired (stale) entry from a previous, successful call in the cache. In that case, this stale entry is used to answer instead of the 5xx response. Otherwise, the expired entries are ignored.
We would be happy if you would accept this change and thus expand the possibilities of the use of this plugin. Please let me know if you need anything else from me.
At Gitpod, we would like to use this great plugin to use cached entries in case the upstream server answers with an HTTP status code >= 500 (server error). This is similar to the
proxy_cache_use_stale
option of nginx (see nginx docs).This PR adds a new config option
stale_max_age
with a default of0
. If this value is > 0, this duration is added to the expiration time. That means entries are kept in the cache for this time after they have already expired. When the upstream server answers with an HTTP status code >= 500 (server error) this plugin checks whether there is still an expired (stale) entry from a previous, successful call in the cache. In that case, this stale entry is used to answer instead of the 5xx response. Otherwise, the expired entries are ignored.We would be happy if you would accept this change and thus expand the possibilities of the use of this plugin. Please let me know if you need anything else from me.