-
Notifications
You must be signed in to change notification settings - Fork 23
Open
Description
Summary
Update the .NET 10 Blazor Server Store app to use MapStaticAssets instead of UseStaticFiles to get build-time compression, fingerprinting, and improved caching behavior. Consider short-circuiting the pipeline for matched static assets.
Why
Microsoft Learn recommends MapStaticAssets (.NET 9+) for optimized static asset delivery (compression for JS/CSS, fingerprinting, content-based ETags, and cache headers). It can also short-circuit the middleware pipeline for static asset requests.
Guidance (docs)
- Static files in ASP.NET Core: https://learn.microsoft.com/aspnet/core/fundamentals/static-files?view=aspnetcore-10.0
- Blazor static files: https://learn.microsoft.com/aspnet/core/blazor/fundamentals/static-files?view=aspnetcore-10.0
Acceptance criteria
Storeusesapp.MapStaticAssets()inProgram.cs(or equivalent) for static asset delivery.- Static asset requests can be configured with
.ShortCircuit()where appropriate. - Verify the app still serves framework/static assets correctly in Development and Production.
Notes
- If the app serves any assets added post-deployment or from non-build locations, retain/augment
UseStaticFilesonly for those scenarios.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels