You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafficserver.apache.org by jpeach <gi...@git.apache.org> on 2016/08/12 21:27:54 UTC

[GitHub] trafficserver pull request #864: TS-4751: Prune cached headers before mergin...

GitHub user jpeach opened a pull request:

    https://github.com/apache/trafficserver/pull/864

    TS-4751: Prune cached headers before merging the updated response.

    When we update a cached response with a new server response, make
    sure to delete any cache-related beforehand. This is needed to
    handle the situation where an origin returns Age on an initial
    response but not on subsequent responses. We should not preserve
    the initial Age in this case.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/jpeach/trafficserver fix/4571

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/trafficserver/pull/864.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #864
    
----
commit c12eaad61793caebe913ff2a6285726c139d64ba
Author: James Peach <jp...@apache.org>
Date:   2016-08-12T21:15:29Z

    TS-4751: Prune cached headers before merging the updated response.
    
    When we update a cached response with a new server response, make
    sure to delete any cache-related beforehand. This is needed to
    handle the situation where an origin returns Age on an initial
    response but not on subsequent responses. We should not preserve
    the initial Age in this case.

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] trafficserver pull request #864: TS-4751: Prune cached headers before mergin...

Posted by jpeach <gi...@git.apache.org>.
Github user jpeach closed the pull request at:

    https://github.com/apache/trafficserver/pull/864


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] trafficserver pull request #864: TS-4751: Prune cached headers before mergin...

Posted by bryancall <gi...@git.apache.org>.
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.



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] trafficserver issue #864: TS-4751: Prune cached headers before merging the u...

Posted by atsci <gi...@git.apache.org>.
Github user atsci commented on the issue:

    https://github.com/apache/trafficserver/pull/864
  
    Linux build *successful*! See https://ci.trafficserver.apache.org/job/Github-Linux/440/ for details.
     



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] trafficserver issue #864: TS-4751: Prune cached headers before merging the u...

Posted by bryancall <gi...@git.apache.org>.
Github user bryancall commented on the issue:

    https://github.com/apache/trafficserver/pull/864
  
    @jpeach I would be OK with deleting the Expires header, but I think we should keep the Cache-Control, Last-Modified, and Vary.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] trafficserver issue #864: TS-4751: Prune cached headers before merging the u...

Posted by zwoop <gi...@git.apache.org>.
Github user zwoop commented on the issue:

    https://github.com/apache/trafficserver/pull/864
  
    The safer of the two seems to be to honor the last seen header.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] trafficserver issue #864: TS-4751: Prune cached headers before merging the u...

Posted by atsci <gi...@git.apache.org>.
Github user atsci commented on the issue:

    https://github.com/apache/trafficserver/pull/864
  
    FreeBSD build *successful*! See https://ci.trafficserver.apache.org/job/Github-FreeBSD/531/ for details.
     



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] trafficserver issue #864: TS-4751: Prune cached headers before merging the u...

Posted by atsci <gi...@git.apache.org>.
Github user atsci commented on the issue:

    https://github.com/apache/trafficserver/pull/864
  
    Linux build *successful*! See https://ci.trafficserver.apache.org/job/Github-Linux/428/ for details.
     



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] trafficserver issue #864: TS-4751: Prune cached headers before merging the u...

Posted by jpeach <gi...@git.apache.org>.
Github user jpeach commented on the issue:

    https://github.com/apache/trafficserver/pull/864
  
    I guess the key phrase from RFC 2616 is ``if the field-value might differ from that sent in any previous response``. What happens if the origin had an ``Expires`` but not it doesn't? RFC7232 would say that we MUST not use the ``Expires`` we have, but RFC2616 says we should. I think this could easily happen with an origin server configuration change.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] trafficserver issue #864: TS-4751: Prune cached headers before merging the u...

Posted by bryancall <gi...@git.apache.org>.
Github user bryancall commented on the issue:

    https://github.com/apache/trafficserver/pull/864
  
    \U0001f44d - Looks good


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] trafficserver issue #864: TS-4751: Prune cached headers before merging the u...

Posted by atsci <gi...@git.apache.org>.
Github user atsci commented on the issue:

    https://github.com/apache/trafficserver/pull/864
  
    FreeBSD build *successful*! See https://ci.trafficserver.apache.org/job/Github-FreeBSD/544/ for details.
     



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] trafficserver issue #864: TS-4751: Prune cached headers before merging the u...

Posted by atsci <gi...@git.apache.org>.
Github user atsci commented on the issue:

    https://github.com/apache/trafficserver/pull/864
  
    FreeBSD build *failed*! See https://ci.trafficserver.apache.org/job/Github-FreeBSD/543/ for details.
     



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] trafficserver issue #864: TS-4751: Prune cached headers before merging the u...

Posted by jpeach <gi...@git.apache.org>.
Github user jpeach commented on the issue:

    https://github.com/apache/trafficserver/pull/864
  
    Ping @zwoop @bryancall @SolidWallOfCode 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] trafficserver pull request #864: TS-4751: Prune cached headers before mergin...

Posted by jpeach <gi...@git.apache.org>.
GitHub user jpeach reopened a pull request:

    https://github.com/apache/trafficserver/pull/864

    TS-4751: Prune cached headers before merging the updated response.

    When we update a cached response with a new server response, make
    sure to delete any cache-related beforehand. This is needed to
    handle the situation where an origin returns Age on an initial
    response but not on subsequent responses. We should not preserve
    the initial Age in this case.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/jpeach/trafficserver fix/4571

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/trafficserver/pull/864.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #864
    
----
commit c12eaad61793caebe913ff2a6285726c139d64ba
Author: James Peach <jp...@apache.org>
Date:   2016-08-12T21:15:29Z

    TS-4751: Prune cached headers before merging the updated response.
    
    When we update a cached response with a new server response, make
    sure to delete any cache-related beforehand. This is needed to
    handle the situation where an origin returns Age on an initial
    response but not on subsequent responses. We should not preserve
    the initial Age in this case.

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] trafficserver issue #864: TS-4751: Prune cached headers before merging the u...

Posted by jpeach <gi...@git.apache.org>.
Github user jpeach commented on the issue:

    https://github.com/apache/trafficserver/pull/864
  
    AFAICT the RFC7232 language was introduced in HTTPbis ticket [#406](https://tools.ietf.org/wg/httpbis/trac/ticket/406). It seems like this change was regarded as a bug fix to RFC2616 rather than a change in requirement or semantics.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] trafficserver pull request #864: TS-4751: Prune cached headers before mergin...

Posted by jpeach <gi...@git.apache.org>.
Github user jpeach closed the pull request at:

    https://github.com/apache/trafficserver/pull/864


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] trafficserver issue #864: TS-4751: Prune cached headers before merging the u...

Posted by jpeach <gi...@git.apache.org>.
Github user jpeach commented on the issue:

    https://github.com/apache/trafficserver/pull/864
  
    Updated to only delete Age, ETag and Expires from the cached header.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] trafficserver issue #864: TS-4751: Prune cached headers before merging the u...

Posted by jpeach <gi...@git.apache.org>.
Github user jpeach commented on the issue:

    https://github.com/apache/trafficserver/pull/864
  
    The problem we hit was we had a bogus Age (12000) header cached. Since the origin was no linger sending an Age header, the object would never become fresh.
    
    One common case could be an origin that sends Expires, then is reconfigured to not send Expires. In this case, we would always keep the Expires from the cached header which would be wrong. 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---