You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 3134b44
Browse filesBrowse the repository at this point in the historyBrowse files
The `dynamic` phase is skipped when `router.load()` produces a redirect.
131
131
132
-
## Final`Link`Headers and CDNs
132
+
## Response`Link`Header and CDNs
133
133
134
-
You can also attach the same serialized values to the final HTML response as HTTP `Link`headers. A final`Link` header does not hide server think time like a `103` response does, but the browser receives it before parsing the HTML body, so it can still start supported preloads and preconnects somewhat earlier.
134
+
You can also attach the same serialized values to the HTML response's HTTP `Link`header. A response`Link` header does not hide server think time like a `103` response does, but the browser receives it before parsing the HTML body, so it can still start supported preloads and preconnects somewhat earlier.
135
135
136
-
Final`Link` headers are also useful for CDNs that generate their own Early Hints. For example, [Cloudflare Early Hints](https://developers.cloudflare.com/cache/advanced-configuration/early-hints/) can read `Link` headers from HTML responses, cache them, and emit `103` responses for later requests.
136
+
Response`Link` headers are also useful for CDNs that generate their own Early Hints. For example, [Cloudflare Early Hints](https://developers.cloudflare.com/cache/advanced-configuration/early-hints/) can read `Link` headers from HTML responses, cache them, and emit `103` responses for later requests.
137
137
138
-
Start does not add final`Link` headers automatically. It cannot know whether those headers will be used only by the browser for the current response, stored by a shared cache, or replayed later as CDN-generated Early Hints.
138
+
Start does not add response`Link` headers automatically. It cannot know whether those headers will be used only by the browser for the current response, stored by a shared cache, or replayed later as CDN-generated Early Hints.
139
139
140
-
Final`Link` headers are most useful when:
140
+
Response`Link` headers are most useful when:
141
141
142
142
- You need a fallback for runtimes that cannot write `103` responses
143
-
- Your CDN can generate Early Hints from final response `Link` headers
143
+
- Your CDN can generate Early Hints from response `Link` headers
144
144
145
145
Good links to include are public and cache-stable for the response's cache boundary, such as:
146
146
@@ -157,50 +157,33 @@ Avoid or filter links before they reach a shared cache or CDN when they are:
157
157
158
158
Cloudflare documents several important caveats: its Early Hints cache ignores query strings, it can emit cached hints before reaching your origin or Worker, and it only generates hints from selected final response status codes and `Link` relations.
159
159
160
-
Because of those cache semantics, prefer public static links for CDN-generated Early Hints. Use `allLinks`only when every dynamic `head().links` entry is public and cache-stable for the request URI.
160
+
Because of those cache semantics, use response `Link` headers only when every emitted static or dynamic link is public and cache-stable for the request URI. Use `responseLinkHeader.filter` to remove links that are not safe for your cache boundary.
161
161
162
-
This example appends static links to the final HTML response. It gives non-`103` runtimes a fallback and lets CDNs such as Cloudflare generate Early Hints from public route assets:
162
+
This example appends all collected static and dynamic links to non-redirect HTML responses. It gives non-`103` runtimes a fallback and lets CDNs such as Cloudflare generate Early Hints from route assets and `head().links` entries that are public and cache-safe:
0 commit comments