Skip to content

Commit ba9968c

Browse files
committed
Add note about Clear-Site-Data in Chrome 138
1 parent 7dbc488 commit ba9968c

File tree

3 files changed

+32
-1
lines changed

3 files changed

+32
-1
lines changed

_posts/2019-03-04-cache-control-for-civilians.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
layout: post
33
title: "Cache-Control for Civilians"
44
date: 2019-03-04 01:21:39
5+
last_modified_at: 2025-06-05
56
categories: Web Development
67
meta: "What does Cache-Control really do? In basic terms? Let’s find out!"
78
---
@@ -453,7 +454,11 @@ Opera.
453454

454455
**Tip:** There are a number of directives that `Clear-Site-Data` will accept:
455456
`"cookies"`, `"storage"`, `"executionContexts"`, and `"*"` (which, naturally,
456-
means ‘all of the above’).
457+
means ‘all of the above’), and starting with [Chrome
458+
138](https://developer.chrome.com/blog/chrome-138-beta#speculation_rules_add_prefetchcache_and_prerendercache_to_clear-site-data_header),
459+
support for the `prefetchCache` and `prerenderCache` directives is added to help
460+
you clear caches populated by [Speculation
461+
Rules](/2024/12/a-layered-approach-to-speculation-rules/).
457462

458463
- - -
459464

_posts/2023-10-02-clear-cache-on-customer-device.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
layout: post
33
title: "How to Clear Cache and Cookies on a Customer’s Device"
44
date: 2023-10-02 15:30:49
5+
last_modified_at: 2025-06-05
56
categories: Web Development
67
main: "https://csswizardry.com/wp-content/uploads/2023/10/clear-site-data.png?1"
78
meta: "There’s a super quick and easy way to clear cache on your customers’ devices. Are you using it yet?"
@@ -84,6 +85,20 @@ will notice performance degradations. While ever the header is live, you will be
8485
constantly evicting users’ caches, effectively disabling caching for your site
8586
the whole time. Tread carefully!
8687

88+
## <ins datetime="2025-06-05">Clearing Speculation Rules’ Cache</ins>
89+
90+
Starting in [Chrome
91+
138](https://developer.chrome.com/blog/chrome-138-beta#speculation_rules_add_prefetchcache_and_prerendercache_to_clear-site-data_header),
92+
`Clear-Site-Data` is being extended by two additional directives that will empty
93+
the prefetch and prerender caches respectively:
94+
95+
```http
96+
Clear-Site-Data: "prefetchCache", "prerenderCache"
97+
```
98+
99+
This will be particularly useful in cases you may have misconfigured your
100+
[Speculation Rules](/2024/12/a-layered-approach-to-speculation-rules/).
101+
87102
## Clearing Cache on iOS
88103

89104
Unfortunately, `Clear-Site-Data` is not supported by Safari, and as all browsers

_posts/2024-12-02-a-layered-approach-to-speculation-rules.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
layout: post
33
title: "A Layered Approach to Speculation Rules"
44
date: 2024-12-02 00:01:56
5+
last_modified_at: 2025-06-05
56
categories: Web Development
67
main: "https://csswizardry.com/wp-content/uploads/2024/12/speculation-rules-poster.jpg"
78
meta: "The new Speculation Rules API is incredibly powerful, but we can do so much more! By taking a layered, opt-in approach, we can add more progressive and effective functionality."
@@ -451,6 +452,16 @@ I guess my point after all of this is that I think this is quite an elegant
451452
pattern and I’m quite happy with myself. If you’d like to be happy with me, too,
452453
I’m taking on [new clients for 2025](/services/).
453454

455+
## <ins datetime="2025-06-05">Clearing Speculation Rules’ Cache With `Clear-Site-Data`</ins>
456+
457+
In the [upcoming Chrome 138
458+
release](https://developer.chrome.com/blog/chrome-138-beta#speculation_rules_add_prefetchcache_and_prerendercache_to_clear-site-data_header),
459+
the [`Clear-Site-Data` HTTP response
460+
header](/2023/10/clear-cache-on-customer-device/) is being extended to add
461+
support for both the `prefetchCache` and `prerenderCache` directives. These can
462+
be used by developers to forcibly purge end-users caches in the event you may
463+
have incorrectly or misconfigured something in or around your Speculation Rules.
464+
454465
<small>Thanks to [Barry Pollard](https://x.com/tunetheweb) for sense-checks and
455466
streamlining.</small>
456467

0 commit comments

Comments
 (0)