Skip to content

Add test for Clear-Site-Data: "cache" in not-same-site origin. - #61543

Draft
fred-wang wants to merge 1 commit into
masterfrom
clear-site-data-in-not-same-site-origin
Draft

Add test for Clear-Site-Data: "cache" in not-same-site origin.#61543
fred-wang wants to merge 1 commit into
masterfrom
clear-site-data-in-not-same-site-origin

Conversation

@fred-wang

Copy link
Copy Markdown
Contributor

This is a tentative test for https://bugs.webkit.org/show_bug.cgi?id=315416

@fred-wang
fred-wang marked this pull request as draft July 27, 2026 09:33
@wpt-pr-bot
wpt-pr-bot requested review from mikewest and msramek July 27, 2026 09:34
@fred-wang
fred-wang force-pushed the clear-site-data-in-not-same-site-origin branch from 6bcac44 to 70eaa5e Compare July 27, 2026 09:35
@fred-wang

Copy link
Copy Markdown
Contributor Author

I'm making this a draft because the test currently only passes in Firefox, so I might be missing some subtle server setup with WPT or browser caching behavior...

In WebKit, test Resource not in cache after clearing cache fails. This is expected because of https://bugs.webkit.org/show_bug.cgi?id=315416 but even with the patch there it's still failing for some reason?

In Chromium, test Resource in cache after first load fails, so it seems the image is never cached.


Here are equivalent manual steps:

  1. Go to https://wpt.live/ and open the devtools' console.
  2. Execute await fetch("https://wpt.live/images/green-100x100.png?pipe=header(Cache-Control,max-age=3600)").then(_ => _.bytes()).then(_ => performance.getEntriesByType("resource").at(-1).transferSize) twice. It should return 0 the second time (i.e. resource is in cache).
  3. Execute await fetch("/clear-site-data/support/echo-clear-site-data.py?cache").then(_ => _.text()) to clear the browser cache.
  4. Execute command from step 2 again, it should return 40579 > 300 (i.e. resource is no longer in cache).

That time, we see expected behavior in Firefox and Chromium but not in WebKit. And we get expected behavior in WebKit with the patch for bug 315416 applied.

@fred-wang
fred-wang force-pushed the clear-site-data-in-not-same-site-origin branch from 70eaa5e to 16292b6 Compare July 27, 2026 13:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants