Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 96437189e7eecba977fe0a452b7e35fecc6ea776
      
https://github.com/WebKit/WebKit/commit/96437189e7eecba977fe0a452b7e35fecc6ea776
  Author: Devin Rousso <[email protected]>
  Date:   2026-07-23 (Thu, 23 Jul 2026)

  Changed paths:
    A 
LayoutTests/http/tests/cache/disable-resource-caching-preserves-request-cache-control-expected.txt
    A 
LayoutTests/http/tests/cache/disable-resource-caching-preserves-request-cache-control.html
    M Source/WebCore/loader/FrameLoader.cpp

  Log Message:
  -----------
  Web Inspector: Network: disabling resource cache always sets `Cache-Control: 
no-cache`
https://bugs.webkit.org/show_bug.cgi?id=320033

Reviewed by Basuke Suzuki.

When Web Inspector disables the resource cache, 
`FrameLoader::updateRequestAndAddExtraFields` forces every request to 
`ReloadIgnoringCacheData` and `ReloadFromOrigin`, then overwrites 
`Cache-Control` and `Pragma` with `no-cache`.
That discards a `Cache-Control` the page set itself (for example through 
`fetch()`), so the value the page asked for never reaches the network.

Only synthesize the `no-cache` headers when the request does not already carry 
them, using `addHTTPHeaderFieldIfNotPresent` instead of `setHTTPHeaderField`.
The cache policy is still forced to `ReloadIgnoringCacheData`, so disabling the 
cache keeps bypassing the local cache and only the header write changes.

* Source/WebCore/loader/FrameLoader.cpp:
(WebCore::FrameLoader::updateRequestAndAddExtraFields):

* 
LayoutTests/http/tests/cache/disable-resource-caching-preserves-request-cache-control.html:
 Added.
* 
LayoutTests/http/tests/cache/disable-resource-caching-preserves-request-cache-control-expected.txt:
 Added.

Canonical link: https://commits.webkit.org/317814@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to