Traffic Server
  1. Traffic Server
  2. TS-824

Range requests that result in cache refresh give 200 status response with full contents

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.1.9, 2.1.8, 2.1.7, 2.1.6, 2.1.5, 2.1.4
    • Fix Version/s: 3.1.1
    • Component/s: HTTP
    • Labels:
      None

      Description

      If you send a request with a Range: header to TS when it has full cached contents that need to be refreshed, and they get back a status 304 response indicating that the cached contents are up to date, TS will respond to the client with a status 200 response, and the full contents. So the content is served from cache, but do not go through the transform to only return partial bytes and a status 206 response like it should.

      1. TS-824-2.diff
        3 kB
        Leif Hedstrom

        Activity

        Hide
        Leif Hedstrom added a comment -

        Moving out some bugs to 3.1.1, please rearrange if you plan on fixing any of these in the next few weeks.

        Show
        Leif Hedstrom added a comment - Moving out some bugs to 3.1.1, please rearrange if you plan on fixing any of these in the next few weeks.
        Hide
        Conan Wang added a comment -

        Just found this bug. Vote for it. And hope to backport to 3.0.x.

        Show
        Conan Wang added a comment - Just found this bug. Vote for it. And hope to backport to 3.0.x.
        Hide
        William Bardwell added a comment -

        I looked at this, and it looks like HttpTransact::build_response_from_cache()'s code when it gets HTTP_STATUS_NOT_MODIFIED(304) never tries to do s->state_machine->do_range_setup_if_necessary();
        (which it does do on status 200's), but there is a bunch of other range code when status is 200 that might also need to be used in the 304 case.

        Show
        William Bardwell added a comment - I looked at this, and it looks like HttpTransact::build_response_from_cache()'s code when it gets HTTP_STATUS_NOT_MODIFIED(304) never tries to do s->state_machine->do_range_setup_if_necessary(); (which it does do on status 200's), but there is a bunch of other range code when status is 200 that might also need to be used in the 304 case.
        Hide
        Kingsley Foreman added a comment -

        I'm being effected by this bug too, second the vote to get it it fixed

        Show
        Kingsley Foreman added a comment - I'm being effected by this bug too, second the vote to get it it fixed
        Hide
        Leif Hedstrom added a comment -

        Here's something that solves at least some of the problem... Feedback and comments appreciated.

        Show
        Leif Hedstrom added a comment - Here's something that solves at least some of the problem... Feedback and comments appreciated.
        Hide
        Leif Hedstrom added a comment -

        Updated diff.

        Show
        Leif Hedstrom added a comment - Updated diff.
        Hide
        Conan Wang added a comment -

        Diff works in my test case. curl -H "Range: bytes=1-2"

        Show
        Conan Wang added a comment - Diff works in my test case. curl -H "Range: bytes=1-2"
        Hide
        Leif Hedstrom added a comment -

        I'd like for a least one more review, and test, before I commit this. I've asked Charlie Gero to test it as well, since William is out for a few weeks.

        Show
        Leif Hedstrom added a comment - I'd like for a least one more review, and test, before I commit this. I've asked Charlie Gero to test it as well, since William is out for a few weeks.
        Hide
        Conan Wang added a comment -

        Can I apply the commit's patch to 3.0.1 code?

        Show
        Conan Wang added a comment - Can I apply the commit's patch to 3.0.1 code?

          People

          • Assignee:
            Leif Hedstrom
            Reporter:
            William Bardwell
          • Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development