Bug 79773 - cached resources are not reused when there are no cache headers present
Summary: cached resources are not reused when there are no cache headers present
Status: ASSIGNED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Page Loading (show other bugs)
Version: 528+ (Nightly build)
Hardware: Mac (Intel) OS X 10.6
: P2 Enhancement
Assignee: Shezan Baig
URL: http://dabblet.com/result/gist/1931852
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2012-02-28 03:04 PST by Lea Verou
Modified: 2012-05-10 11:00 PDT (History)
11 users (show)

See Also:


Attachments
reduced test case (508 bytes, text/html)
2012-04-13 07:19 PDT, Shezan Baig
no flags Details
Patch (4.49 KB, patch)
2012-04-13 10:17 PDT, Shezan Baig
ap: review-
webkit.review.bot: commit-queue-
Details | Formatted Diff | Diff
Archive of layout-test-results from ec2-cr-linux-01 (6.76 MB, application/zip)
2012-04-13 12:19 PDT, WebKit Review Bot
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Lea Verou 2012-02-28 03:04:04 PST
Hover over the image in the testcase. You will see that the second image loads again, although it had already been loaded for cross-fade() to work. This is wasteful and should be rectified.
Comment 1 Radar WebKit Bug Importer 2012-02-28 09:20:56 PST
<rdar://problem/10946032>
Comment 2 Shezan Baig 2012-04-13 07:19:58 PDT
Created attachment 137083 [details]
reduced test case

reduced test case by removing cross-fade (which appears to no longer work in firefox, btw).

We load 2 images, and when mouse hover on the first image, we change it to the second image.  In firefox, this change is instantaneous, but in webkit, this change reloads the image.

the issue has nothing to do with cross-fade itself, but has to do with the fact that cached resources is not reused when there are no cache headers present.  Specifically, CachedResource::freshnessLifetime currently returns 0.  The comment says that other browsers do this, but it seems like firefox doesn't.

I plan to fix this by bumping it up from 0 to 3600 (i.e. 1 hour).  I'm open to alternate suggestions though.
Comment 3 Simon Fraser (smfr) 2012-04-13 08:36:20 PDT
Please re-title this bug to reflect the actual issue.
Comment 4 Shezan Baig 2012-04-13 10:17:21 PDT
Created attachment 137100 [details]
Patch

returning 3600 in freshnessLifetime if no cache headers present
Comment 5 Alexey Proskuryakov 2012-04-13 10:29:04 PDT
Antti should review this.
Comment 6 Antti Koivisto 2012-04-13 10:36:24 PDT
What is the current behavior in other engines? It seems bit risky to change this if everyone else considers these resources uncacheable.
Comment 7 Antti Koivisto 2012-04-13 10:52:14 PDT
Ah you mentioned Firefox. Wonder what their exact behavior is?
Comment 8 Shezan Baig 2012-04-13 11:31:37 PDT
I'm not sure what their exact behavior is, i'll investigate this further
Comment 9 WebKit Review Bot 2012-04-13 12:19:12 PDT
Comment on attachment 137100 [details]
Patch

Attachment 137100 [details] did not pass chromium-ews (chromium-xvfb):
Output: http://queues.webkit.org/results/12405044

New failing tests:
http/tests/misc/script-async.html
http/tests/xmlhttprequest/access-control-basic-allow-preflight-cache.html
Comment 10 WebKit Review Bot 2012-04-13 12:19:19 PDT
Created attachment 137123 [details]
Archive of layout-test-results from ec2-cr-linux-01

The attached test failures were seen while running run-webkit-tests on the chromium-ews.
Bot: ec2-cr-linux-01  Port: <class 'webkitpy.common.config.ports.ChromiumXVFBPort'>  Platform: Linux-2.6.35-28-virtual-x86_64-with-Ubuntu-10.10-maverick
Comment 11 Ryosuke Niwa 2012-05-10 00:56:39 PDT
This is definitely not a CSS bug.
Comment 12 Alexey Proskuryakov 2012-05-10 11:00:35 PDT
Comment on attachment 137100 [details]
Patch

This change needs supportive evidence. Please feel free to ask for review again with evidence provided.