WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
244000
NetworkCache uses URL instead of URI as a part of caching key
https://bugs.webkit.org/show_bug.cgi?id=244000
Summary
NetworkCache uses URL instead of URI as a part of caching key
cathiechen
Reported
2022-08-16 11:07:12 PDT
Per [1], the key is composed of, at a minimum, the request method and target URI. But in NetworkCache, Cache::makeCacheKey uses URL instead. We have a test to reproduce that the cache does not work: - Open [2] and click the button to add fragment to the URL, then click the link on the page. - Terminate safari and reopen it. - Hit back button. The page is downloaded from network instead of disk. Because the browser is terminated, there is no page cache after reopen. Then it goes to network process to get the data, it checks the NetworkCache first, but there is no entry found for the key does not match. It stores by "
https://perfect-lively-xylophone.glitch.me/
", but when retrieve, the key is "
https://perfect-lively-xylophone.glitch.me/#somefragment
". Not sure if we could treat this key same as the http cache[1], but "fragment identifiers are reserved for client-side processing". Looks like the cache should be reused. [1]
https://httpwg.org/specs/rfc9111.html#caching.overview
[2]
https://perfect-lively-xylophone.glitch.me/
Attachments
WIP-patch
(2.12 KB, patch)
2022-08-16 11:15 PDT
,
cathiechen
ews-feeder
: commit-queue-
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
cathiechen
Comment 1
2022-08-16 11:15:34 PDT
Created
attachment 461679
[details]
WIP-patch Upload a WIP patch which use url().stringWithoutFragmentIdentifier() instead of url() as the key.
Alex Christensen
Comment 2
2022-08-16 14:39:46 PDT
This seems like a reasonable change, but needs a test.
Alex Christensen
Comment 3
2022-08-16 14:55:48 PDT
There may be something in LayoutTests/http/tests/cache that is similar to a test we would want for this.
cathiechen
Comment 4
2022-08-18 10:06:43 PDT
Pull request:
https://github.com/WebKit/WebKit/pull/3458
cathiechen
Comment 5
2022-08-18 10:13:02 PDT
(In reply to Alex Christensen from
comment #3
)
> There may be something in LayoutTests/http/tests/cache that is similar to a > test we would want for this.
Thanks a lot, Alex! I added a function to generate fragment in LayoutTests/http/tests/cache/disk-cache/resources/cache-test.js Please take a look at the pull request:)
EWS
Comment 6
2022-08-18 11:30:14 PDT
Committed
253567@main
(d62692ae68ab): <
https://commits.webkit.org/253567@main
> Reviewed commits have been landed. Closing PR #3458 and removing active labels.
Radar WebKit Bug Importer
Comment 7
2022-08-18 11:31:18 PDT
<
rdar://problem/98841865
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug