Title: [250437] trunk
Revision
250437
Author
[email protected]
Date
2019-09-27 12:09:04 -0700 (Fri, 27 Sep 2019)

Log Message

Allow pages served over HTTPS with `Cache-Control: no-store` header to enter the back/forward cache
https://bugs.webkit.org/show_bug.cgi?id=202314
<rdar://problem/55783482>

Reviewed by Alex Christensen.

Source/WebCore:

Allow pages served over HTTPS with `Cache-Control: no-store` header to enter the back/forward cache.
This was preventing all pages on Facebook.com to enter the back/forward cache.

No new tests, updated existing test.

* history/PageCache.cpp:
(WebCore::canCacheFrame):

LayoutTests:

Update existing test to reflect behavior change.

* http/tests/navigation/https-in-page-cache-expected.txt:
* http/tests/navigation/resources/https-in-page-cache-1.php:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (250436 => 250437)


--- trunk/LayoutTests/ChangeLog	2019-09-27 18:32:47 UTC (rev 250436)
+++ trunk/LayoutTests/ChangeLog	2019-09-27 19:09:04 UTC (rev 250437)
@@ -1,3 +1,16 @@
+2019-09-27  Chris Dumez  <[email protected]>
+
+        Allow pages served over HTTPS with `Cache-Control: no-store` header to enter the back/forward cache
+        https://bugs.webkit.org/show_bug.cgi?id=202314
+        <rdar://problem/55783482>
+
+        Reviewed by Alex Christensen.
+
+        Update existing test to reflect behavior change.
+
+        * http/tests/navigation/https-in-page-cache-expected.txt:
+        * http/tests/navigation/resources/https-in-page-cache-1.php:
+
 2019-09-27  Alexey Shvayka  <[email protected]>
 
         Non-standard Error properties should not be enumerable

Modified: trunk/LayoutTests/http/tests/navigation/https-in-page-cache-expected.txt (250436 => 250437)


--- trunk/LayoutTests/http/tests/navigation/https-in-page-cache-expected.txt	2019-09-27 18:32:47 UTC (rev 250436)
+++ trunk/LayoutTests/http/tests/navigation/https-in-page-cache-expected.txt	2019-09-27 19:09:04 UTC (rev 250437)
@@ -1,5 +1,5 @@
-ALERT: This page is https and has the no-store cache-control directive. It should NOT go in to the page cache.
-ALERT: The page was reloaded on back, not from the page cache. Good job. Running part 2 of the test.
+ALERT: This page is https and has the no-store cache-control directive. It should go in to the page cache.
+ALERT: The page was restored from the page cache. Good job. Running part 2 of the test.
 ALERT: This page is https and has the no-cache cache-control directive. It should go in to the page cache.
 ALERT: The page was restored from the page cache. Good job!. Running part 3 of the test.
 ALERT: This page is https and should go in to the page cache.

Modified: trunk/LayoutTests/http/tests/navigation/resources/https-in-page-cache-1.php (250436 => 250437)


--- trunk/LayoutTests/http/tests/navigation/resources/https-in-page-cache-1.php	2019-09-27 18:32:47 UTC (rev 250436)
+++ trunk/LayoutTests/http/tests/navigation/resources/https-in-page-cache-1.php	2019-09-27 19:09:04 UTC (rev 250437)
@@ -11,7 +11,7 @@
 
 window._onpageshow_ = function(evt) {
 	if (evt.persisted) {
-		alert("The page was restored from the page cache. It should NOT have been. Running part 2 of the test.");
+		alert("The page was restored from the page cache. Good job. Running part 2 of the test.");
 		nextTest();
 	}
 }
@@ -18,12 +18,12 @@
 
 window._onload_ = function() {
 	if (window.sessionStorage.https_in_page_cache_started) {
-		alert("The page was reloaded on back, not from the page cache. Good job. Running part 2 of the test.");
+		alert("The page was reloaded on back, not from the page cache. It should NOT have reloaded. Running part 2 of the test.");
 		nextTest();
 		return;
 	}
 
-	alert("This page is https and has the no-store cache-control directive. It should NOT go in to the page cache.");
+	alert("This page is https and has the no-store cache-control directive. It should go in to the page cache.");
 	window.sessionStorage.https_in_page_cache_started = true;
 	setTimeout('window.location = "go-back.html"', 0);
 

Modified: trunk/Source/WebCore/ChangeLog (250436 => 250437)


--- trunk/Source/WebCore/ChangeLog	2019-09-27 18:32:47 UTC (rev 250436)
+++ trunk/Source/WebCore/ChangeLog	2019-09-27 19:09:04 UTC (rev 250437)
@@ -1,3 +1,19 @@
+2019-09-27  Chris Dumez  <[email protected]>
+
+        Allow pages served over HTTPS with `Cache-Control: no-store` header to enter the back/forward cache
+        https://bugs.webkit.org/show_bug.cgi?id=202314
+        <rdar://problem/55783482>
+
+        Reviewed by Alex Christensen.
+
+        Allow pages served over HTTPS with `Cache-Control: no-store` header to enter the back/forward cache.
+        This was preventing all pages on Facebook.com to enter the back/forward cache.
+
+        No new tests, updated existing test.
+
+        * history/PageCache.cpp:
+        (WebCore::canCacheFrame):
+
 2019-09-27  Devin Rousso  <[email protected]>
 
         Flaky Test: inspector/canvas/updateShader.html

Modified: trunk/Source/WebCore/history/PageCache.cpp (250436 => 250437)


--- trunk/Source/WebCore/history/PageCache.cpp	2019-09-27 18:32:47 UTC (rev 250436)
+++ trunk/Source/WebCore/history/PageCache.cpp	2019-09-27 19:09:04 UTC (rev 250437)
@@ -127,11 +127,6 @@
         logPageCacheFailureDiagnosticMessage(diagnosticLoggingClient, DiagnosticLoggingKeys::hasPluginsKey());
         isCacheable = false;
     }
-    if (frame.isMainFrame() && frame.document() && frame.document()->url().protocolIs("https") && documentLoader->response().cacheControlContainsNoStore()) {
-        PCLOG("   -Frame is HTTPS, and cache control prohibits storing");
-        logPageCacheFailureDiagnosticMessage(diagnosticLoggingClient, DiagnosticLoggingKeys::httpsNoStoreKey());
-        isCacheable = false;
-    }
     if (frame.isMainFrame() && !frameLoader.history().currentItem()) {
         PCLOG("   -Main frame has no current history item");
         logPageCacheFailureDiagnosticMessage(diagnosticLoggingClient, DiagnosticLoggingKeys::noCurrentHistoryItemKey());
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to