Mailing List Archive

#1618: The "Range" header is not honored for a cache miss.
#1618: The "Range" header is not honored for a cache miss.
-------------------------------+--------------------
Reporter: jeffawang | Type: defect
Status: new | Priority: high
Milestone: | Component: build
Version: 4.0.2 | Severity: normal
Keywords: range header miss |
-------------------------------+--------------------
Context: I'm sending a request to the varnish cache (v4.0.2), which sits
on top of a tomcat server that does not support the Range http header.

When I submit a request with "Range: bytes=0-0" to Varnish for a not-yet-
cached object, I get a non-ranged response (more than one byte) and a HTTP
code 200.

When I submit precisely the same request again with the same headers, I
get the ranged response (only the first byte) and a HTTP code 206.
Subsequent requests return ranged 206s, until it's purged from cache.

The expected behavior should be a ranged 206 in each case (cache miss or
cache hit), rather than different responses for the same request.

Specifying the following in VCL makes the cache miss return a ranged 206,
as expected:

{{{
sub vcl_backend_response {
# Workaround for ranged cache-miss 200
set beresp.do_stream = false;
}
}}}

--
Ticket URL: <https://www.varnish-cache.org/trac/ticket/1618>
Varnish <https://varnish-cache.org/>
The Varnish HTTP Accelerator

_______________________________________________
varnish-bugs mailing list
varnish-bugs@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-bugs
Re: #1618: The "Range" header is not honored for a cache miss. [ In reply to ]
#1618: The "Range" header is not honored for a cache miss.
-------------------------------+--------------------
Reporter: jeffawang | Owner:
Type: defect | Status: new
Priority: high | Milestone:
Component: build | Version: 4.0.2
Severity: normal | Resolution:
Keywords: range header miss |
-------------------------------+--------------------

Comment (by lkarsten):

Discussed during bugwash today.

This ties in with #1506. Needs further study.

--
Ticket URL: <https://www.varnish-cache.org/trac/ticket/1618#comment:1>
Varnish <https://varnish-cache.org/>
The Varnish HTTP Accelerator

_______________________________________________
varnish-bugs mailing list
varnish-bugs@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-bugs
Re: #1618: The "Range" header is not honored for a cache miss. [ In reply to ]
#1618: The "Range" header is not honored for a cache miss.
-------------------------------+---------------------
Reporter: jeffawang | Owner: martin
Type: defect | Status: new
Priority: high | Milestone:
Component: build | Version: 4.0.2
Severity: normal | Resolution:
Keywords: range header miss |
-------------------------------+---------------------
Changes (by martin):

* owner: => martin


--
Ticket URL: <https://www.varnish-cache.org/trac/ticket/1618#comment:2>
Varnish <https://varnish-cache.org/>
The Varnish HTTP Accelerator

_______________________________________________
varnish-bugs mailing list
varnish-bugs@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-bugs
Re: #1618: The "Range" header is not honored for a cache miss. [ In reply to ]
#1618: The "Range" header is not honored for a cache miss.
-------------------------------+---------------------
Reporter: jeffawang | Owner: martin
Type: defect | Status: new
Priority: high | Milestone:
Component: build | Version: 4.0.2
Severity: normal | Resolution:
Keywords: range header miss |
-------------------------------+---------------------

Comment (by fgsch):

This is fixed in master. Attached is a testcase for it.

--
Ticket URL: <https://www.varnish-cache.org/trac/ticket/1618#comment:3>
Varnish <https://varnish-cache.org/>
The Varnish HTTP Accelerator

_______________________________________________
varnish-bugs mailing list
varnish-bugs@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-bugs
Re: #1618: The "Range" header is not honored for a cache miss. [ In reply to ]
#1618: The "Range" header is not honored for a cache miss.
-------------------------------+---------------------
Reporter: jeffawang | Owner: martin
Type: defect | Status: new
Priority: high | Milestone:
Component: build | Version: 4.0.2
Severity: normal | Resolution:
Keywords: range header miss |
-------------------------------+---------------------

Comment (by fgsch):

Tried with 4.0.2 and cannot reproduce it.

--
Ticket URL: <https://www.varnish-cache.org/trac/ticket/1618#comment:4>
Varnish <https://varnish-cache.org/>
The Varnish HTTP Accelerator

_______________________________________________
varnish-bugs mailing list
varnish-bugs@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-bugs
Re: #1618: The "Range" header is not honored for a cache miss. [ In reply to ]
#1618: The "Range" header is not honored for a cache miss.
-------------------------------+---------------------
Reporter: jeffawang | Owner: martin
Type: defect | Status: new
Priority: high | Milestone:
Component: build | Version: 4.0.2
Severity: normal | Resolution:
Keywords: range header miss |
-------------------------------+---------------------

Comment (by fgsch):

I've deleted my comments and test - they were wrong.
As Martin pointed out this is due to streaming and not having the Content
Length.

--
Ticket URL: <https://www.varnish-cache.org/trac/ticket/1618#comment:3>
Varnish <https://varnish-cache.org/>
The Varnish HTTP Accelerator

_______________________________________________
varnish-bugs mailing list
varnish-bugs@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-bugs
Re: #1618: The "Range" header is not honored for a cache miss. [ In reply to ]
#1618: The "Range" header is not honored for a cache miss.
-------------------------------+---------------------
Reporter: jeffawang | Owner: martin
Type: defect | Status: closed
Priority: high | Milestone:
Component: build | Version: 4.0.2
Severity: normal | Resolution: fixed
Keywords: range header miss |
-------------------------------+---------------------
Changes (by Poul-Henning Kamp <phk@…>):

* status: new => closed
* resolution: => fixed


Comment:

In [97434c7cef70d99533f1fb7f78419dd5c9d36d23]:
{{{
#!CommitTicketReference repository=""
revision="97434c7cef70d99533f1fb7f78419dd5c9d36d23"
Handle Range requests on streaming objects better.

If the client sends [LO]-HI range, we trust it knows something we don't
(yet),
and do the Range request. If we later ran out of data, we close the
session.

Other range requests on streaming objects are ignored.

Fixes: #1506
Fixes: #1618
}}}

--
Ticket URL: <https://www.varnish-cache.org/trac/ticket/1618#comment:4>
Varnish <https://varnish-cache.org/>
The Varnish HTTP Accelerator

_______________________________________________
varnish-bugs mailing list
varnish-bugs@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-bugs