Skip to content

Commit 9fb61e8

Browse files
authored
Blazor bundle HTTP caching remarks (#36106)
1 parent 46fd037 commit 9fb61e8

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

aspnetcore/blazor/host-and-deploy/index.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,17 @@ Demonstration sample apps for Blazor WebAssembly in a React app (`BlazorWebAssem
137137

138138
:::moniker-end
139139

140+
:::moniker range=">= aspnetcore-8.0"
141+
142+
## Aspects of Blazor WebAssembly caching apply to Blazor Web Apps
143+
144+
Blazor bundle caching and HTTP caching guidance in the *Blazor WebAssembly* node focus on standalone Blazor WebAssembly apps, but several aspects of client-side caching in these articles also apply to Blazor Web Apps that adopt Interactive WebAssembly or Interactive Auto render modes. If a Blazor Web App that renders content client-side encounters a static asset or bundle caching problem, see the guidance in these articles to troubleshoot the problem:
145+
146+
* <xref:blazor/host-and-deploy/webassembly/bundle-caching-and-integrity-check-failures>
147+
* <xref:blazor/host-and-deploy/webassembly/http-caching-issues>
148+
149+
:::moniker-end
150+
140151
## Blazor Server `MapFallbackToPage` configuration
141152

142153
*This section only applies to Blazor Server apps. <xref:Microsoft.AspNetCore.Builder.RazorPagesEndpointRouteBuilderExtensions.MapFallbackToPage%2A> isn't supported in Blazor Web Apps and Blazor WebAssembly apps.*

aspnetcore/blazor/host-and-deploy/webassembly/http-caching-issues.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ While future Blazor releases might provide better solutions for dealing with HTT
2121
Common problems that negatively impact the user upgrade experience include:
2222

2323
* **Incorrect handling of project and package updates**: This happens if you don't update all of the app's deployed projects to use the same major framework version or if you use packages from a previous version when a newer version is available as part of the major upgrade.
24-
* **Incorrect configuration of caching headers**: HTTP caching headers control how, where, and for how long the app's responses are cached. If headers aren't configured correctly, users might receive stale content.
24+
* **Incorrect configuration of caching headers**: HTTP caching headers control how, where, and for how long the app's responses are cached. If headers aren't configured correctly, users might receive stale or mismatched files. This includes [Blazor bundle assets caching](xref:blazor/host-and-deploy/webassembly/bundle-caching-and-integrity-check-failures), where server caching headers must be properly set to avoid caching problems on the client.
2525
* **Incorrect configuration of other layers**: Content Delivery Networks (CDNs) and other layers of the deployed app can cause issues if incorrectly configured. For example, CDNs are designed to cache and deliver content to improve performance and reduce latency. If a CDN is incorrectly serving cached versions of assets, it can lead to stale content delivery to the user.
2626

2727
## Detect and diagnose upgrade issues
@@ -42,7 +42,7 @@ Ensure that framework packages line up with the framework version. Using package
4242

4343
### Verify the presence of correct caching headers
4444

45-
The correct caching headers should be present on responses to resource requests. This includes `ETag`, `Cache-Control`, and other caching headers. The configuration of these headers is dependent on the hosting service or hosting server platform. They are particularly important for assets such as the Blazor script (`blazor.webassembly.js`) and anything the script downloads.
45+
The correct caching headers should be present on responses to resource requests. This includes `ETag`, `Cache-Control`, and other caching headers. The configuration of these headers is dependent on the hosting service or hosting server platform. They are particularly important for assets such as the [Blazor script](xref:blazor/project-structure#location-of-the-blazor-script) and anything the script downloads.
4646

4747
Incorrect HTTP caching headers may also impact service workers. Service workers rely on caching headers to manage cached resources effectively. Therefore, incorrect or missing headers can disrupt the service worker's functionality.
4848

0 commit comments

Comments
 (0)