From 8e47a0dfb46269ce1b32b700bc4eb541c5b0acf2 Mon Sep 17 00:00:00 2001 From: Daniel Aleksandersen Date: Fri, 14 Apr 2017 19:28:14 +0200 Subject: [PATCH] Allow caching of 308 and 410 --- modules/cache/mod_cache.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/modules/cache/mod_cache.c b/modules/cache/mod_cache.c index 5cf04b966f..00642ec1ed 100644 --- a/modules/cache/mod_cache.c +++ b/modules/cache/mod_cache.c @@ -1008,12 +1008,15 @@ static apr_status_t cache_save_filter(ap_filter_t *f, apr_bucket_brigade *in) && r->status != HTTP_PARTIAL_CONTENT && r->status != HTTP_MULTIPLE_CHOICES && r->status != HTTP_MOVED_PERMANENTLY - && r->status != HTTP_NOT_MODIFIED) { - /* RFC2616 13.4 we are allowed to cache 200, 203, 206, 300, 301 or 410 + && r->status != HTTP_NOT_MODIFIED + && r->status != HTTP_PERMANENT_REDIRECT + && r->status != HTTP_GONE) { + /* RFC2616 13.4 we are allowed to cache 200, 203, 206, 300, 301, or 410 * We allow the caching of 206, but a cache implementation might choose * to decline to cache a 206 if it doesn't know how to. * We include 304 Not Modified here too as this is the origin server * telling us to serve the cached copy. + * RFC7538 3 allows us to cache 308. */ if (exps != NULL || cc_out != NULL) { /* We are also allowed to cache any response given that it has a -- 2.11.0 (Apple Git-81)