Changeset 150863 in webkit
- Timestamp:
- May 28, 2013 9:56:08 PM (11 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r150862 r150863 1 2013-05-28 Andy Estes <aestes@apple.com> 2 3 REGRESSION (r150169): Images from file: URLs display after a delay even though they were preloaded by JavaScript 4 https://bugs.webkit.org/show_bug.cgi?id=116906 5 <rdar://problem/13991927> 6 7 Reviewed by Andreas Kling. 8 9 Writing a test for this is blocked on https://webkit.org/b/116199. 10 11 Some WebKit clients use JavaScript to preload images from disk so that 12 subsequent loads will display immediately from the memory cache. By not 13 caching non-HTTP sub-resources in memory, we break this common pattern. 14 This change restricts r150169 to only apply to cached main resources. 15 Sub-resources will again be cached indefinitely as they were prior to 16 r150169. 17 18 * loader/cache/CachedResource.cpp: 19 (WebCore::CachedResource::freshnessLifetime): If this is a non-HTTP 20 main resource from a scheme that should not be cached indefinitely, 21 return 0 for the freshness lifetime. For other non-HTTP cached 22 resources, return an indefinite freshness lifetime. 23 1 24 2013-05-28 Dean Jackson <dino@apple.com> 2 25 -
trunk/Source/WebCore/loader/cache/CachedResource.cpp
r150169 r150863 416 416 double CachedResource::freshnessLifetime() const 417 417 { 418 if (SchemeRegistry::shouldCacheResponsesFromURLSchemeIndefinitely(m_response.url().protocol())) 418 if (!m_response.url().protocolIsInHTTPFamily()) { 419 // Don't cache non-HTTP main resources since we can't check for freshness. 420 // FIXME: We should not cache subresources either, but when we tried this 421 // it caused performance and flakiness issues in our test infrastructure. 422 if (m_type == MainResource && !SchemeRegistry::shouldCacheResponsesFromURLSchemeIndefinitely(m_response.url().protocol())) 423 return 0; 424 419 425 return std::numeric_limits<double>::max(); 420 421 // Don't cache other non-HTTP resources since we can't check for freshness. 422 if (!m_response.url().protocolIsInHTTPFamily()) 423 return 0; 426 } 424 427 425 428 // RFC2616 13.2.4
Note: See TracChangeset
for help on using the changeset viewer.