From: Michael Wallner Date: Thu, 7 May 2015 20:18:35 +0000 (+0200) Subject: only consider 2xx cacheable X-Git-Tag: RELEASE_2_5_0_RC1~3 X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-http;a=commitdiff_plain;h=c3a7a5b7bde5c6490940791c37b40fa39fe055fe only consider 2xx cacheable --- diff --git a/php_http_env_response.c b/php_http_env_response.c index 67a6d58..be7effa 100644 --- a/php_http_env_response.c +++ b/php_http_env_response.c @@ -229,8 +229,9 @@ php_http_cache_status_t php_http_env_is_response_cached_by_last_modified(zval *o static zend_bool php_http_env_response_is_cacheable(php_http_env_response_t *r, php_http_message_t *request) { TSRMLS_FETCH_FROM_CTX(r->ts); + long status = r->ops->get_status(r); - if (r->ops->get_status(r) >= 400) { + if (status && status / 100 != 2) { return 0; }