[
https://issues.apache.org/jira/browse/TS-4751?focusedWorklogId=26404&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-26404
]
ASF GitHub Bot logged work on TS-4751:
--------------------------------------
Author: ASF GitHub Bot
Created on: 12/Aug/16 23:10
Start Date: 12/Aug/16 23:10
Worklog Time Spent: 10m
Work Description: Github user bryancall commented on a diff in the pull
request:
https://github.com/apache/trafficserver/pull/864#discussion_r74672814
--- Diff: proxy/http/HttpTransact.cc ---
@@ -4785,27 +4785,34 @@
HttpTransact::merge_and_update_headers_for_cache_update(State *s)
}
if (s->api_modifiable_cached_resp) {
- ink_assert(s->cache_info.object_store.response_get() != NULL &&
s->cache_info.object_store.response_get()->valid());
+ ink_assert(cached_hdr != NULL && cached_hdr->valid());
s->api_modifiable_cached_resp = false;
} else {
s->cache_info.object_store.response_set(s->cache_info.object_read->response_get());
}
-
merge_response_header_with_cached_header(s->cache_info.object_store.response_get(),
&s->hdr_info.server_response);
+ // Delete caching headers from the cached response. If these are still
being served
+ // by the origin we will copy new versions in from the server response.
+ cached_hdr->field_delete(MIME_FIELD_AGE, MIME_LEN_AGE);
+ cached_hdr->field_delete(MIME_FIELD_CACHE_CONTROL,
MIME_LEN_CACHE_CONTROL);
+ cached_hdr->field_delete(MIME_FIELD_ETAG, MIME_LEN_ETAG);
+ cached_hdr->field_delete(MIME_FIELD_EXPIRES, MIME_LEN_EXPIRES);
+ cached_hdr->field_delete(MIME_FIELD_LAST_MODIFIED,
MIME_LEN_LAST_MODIFIED);
--- End diff --
I don't think it is a good idea to delete Expires, Last-Modifed, or
Cache-Control from the cached object. They are not required to be sent from
the origin according to the HTTP/1.1 RFC on a 304:
https://tools.ietf.org/html/rfc2616#section-10.3.5
The newer RFC (https://tools.ietf.org/html/rfc7232#section-4.1) changed
this, but we should still support RFC2616.
Issue Time Tracking
-------------------
Worklog Id: (was: 26404)
Time Spent: 50m (was: 40m)
> revalidation can skip updating the Age header
> ---------------------------------------------
>
> Key: TS-4751
> URL: https://issues.apache.org/jira/browse/TS-4751
> Project: Traffic Server
> Issue Type: Bug
> Components: Cache, Core
> Reporter: James Peach
> Assignee: James Peach
> Fix For: 7.0.0
>
> Time Spent: 50m
> Remaining Estimate: 0h
>
> In {{HttpTransact::merge_and_update_headers_for_cache_update}}, the cached
> {{Age}} header is only updated if the server response also contains an
> {{Age}} header. If the revalidation response does not contain an {{Age}}, we
> will retain the cache {{Age}} header which makes the document permanently
> stale, causing a revalidation on every request.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)