Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(413)

Issue 10829069: Http cache: Make sure that issuing a byte range request (Closed)

Created:
8 years, 4 months ago by rvargas (doing something else)
Modified:
8 years, 4 months ago
Reviewers:
gavinp
CC:
chromium-reviews, cbentzel+watch_chromium.org, darin-cc_chromium.org, gavinp+disk_chromium.org
Visibility:
Public.

Description

Http cache: Make sure that issuing a byte range request does not prevent caching of responses that are not 200, and does not delete the cached response if not really needed. For example, we should be able to cache redirects when the request is made using a byte range. BUG=134267 TEST=net_unittests Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=149069

Patch Set 1 #

Total comments: 8

Patch Set 2 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+80 lines, -28 lines) Patch
M net/http/http_cache_transaction.h View 1 chunk +5 lines, -0 lines 0 comments Download
M net/http/http_cache_transaction.cc View 1 5 chunks +41 lines, -19 lines 0 comments Download
M net/http/http_cache_unittest.cc View 3 chunks +30 lines, -5 lines 0 comments Download
M net/http/partial_data.cc View 3 chunks +4 lines, -4 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
rvargas (doing something else)
8 years, 4 months ago (2012-07-28 01:15:11 UTC) #1
gavinp
LGTM. Great catch! My comments are all nits. Do what you will with them. http://codereview.chromium.org/10829069/diff/1/net/http/http_cache_transaction.cc ...
8 years, 4 months ago (2012-07-30 18:35:07 UTC) #2
rvargas (doing something else)
8 years, 4 months ago (2012-07-30 21:38:52 UTC) #3
Thanks.

http://codereview.chromium.org/10829069/diff/1/net/http/http_cache_transactio...
File net/http/http_cache_transaction.cc (right):

http://codereview.chromium.org/10829069/diff/1/net/http/http_cache_transactio...
net/http/http_cache_transaction.cc:1578: // Only force revalidation for sparse
or truncated entries.
On 2012/07/30 18:35:07, gavinp wrote:
> I think the "Only" here is a bit confusing: skip_validation can be false for
> other reasons, right, such as net::HttpCache::PLAYBACK?

but this is not about skip_validation being false, but about ignoring the
regular logic for that and deciding to check anyway.

Updated the comment.

> 
> Separately, I think we still skip validation if the request is for a range
that
> we have cached.. 
> 
> So I propose:
> 
> // Force revalidation for sparse or truncated entries if we aren't requesting
> from the cached range.

http://codereview.chromium.org/10829069/diff/1/net/http/http_cache_transactio...
net/http/http_cache_transaction.cc:1605: return DoRestartPartialRequest();
On 2012/07/30 18:35:07, gavinp wrote:
> So this makes me sad because if we have a range cached, and issue a partial
> request that includes that range, we just ignore the range we do have cached.
Is
> that right?

Not unless we are unable to conditionalize the request.

We used to discard the cached copy as soon as the strong validator check failed
(when asked for a range). Now we wait to see if we actually have to issue a
conditional request.

http://codereview.chromium.org/10829069/diff/1/net/http/partial_data.cc
File net/http/partial_data.cc (right):

http://codereview.chromium.org/10829069/diff/1/net/http/partial_data.cc#newco...
net/http/partial_data.cc:277: DVLOG(2) << "UpdateFromStoredHeaders size: " <<
resource_size_;
On 2012/07/30 18:35:07, gavinp wrote:
> Should this DVLOG be deleted??

Not sure. I've used this one to get an idea of where something is amiss. But
more often than not I use some other technique rather than longs.

Powered by Google App Engine
This is Rietveld 408576698