Document UseDefaultFiles ordering requirement for compressed default documents#37315
Open
wadepickett with Copilot wants to merge 4 commits into
Open
Document UseDefaultFiles ordering requirement for compressed default documents#37315wadepickett with Copilot wants to merge 4 commits into
wadepickett with Copilot wants to merge 4 commits into
Conversation
Copilot
AI
changed the title
[WIP] Update documentation for Default Files Middleware placement
Document UseDefaultFiles ordering requirement for compressed default documents
Jul 6, 2026
wadepickett
reviewed
Jul 6, 2026
|
|
||
| Map Static Assets doesn't provide features for minification or other file transformations. Minification is usually handled by custom code or [third-party tooling](xref:blazor/fundamentals/index#community-links-to-blazor-resources). | ||
|
|
||
| > [!NOTE] |
Contributor
There was a problem hiding this comment.
This following note is the main point of this PR as related to the issue it fixes. Everything else changed in the PR is just some clean up per the style guide spotted along the way and fixed.
wadepickett
approved these changes
Jul 6, 2026
Contributor
|
@tdykstra, could use your review. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #36469
The Static files article documents both
MapStaticAssets(endpoint-based, serves build-time compressed assets) andUseDefaultFiles(a URL rewriter), but omits the ordering interaction between them: a default document is only served as a compressed static asset when theUseDefaultFilespath rewrite runs before endpoint routing matches the request — i.e.,UseDefaultFilesmust be called beforeMapStaticAssets.Changes to
aspnetcore/fundamentals/static-files.md:MapStaticAssetscompression benefits — Explains that default documents are served compressed only whenUseDefaultFilesruns before Routing Middleware, with the why (the/→/index.htmlrewrite must precede endpoint matching) and the actionable guidance (callUseDefaultFilesbeforeMapStaticAssets). Phrased to avoid implying readers must manually addUseRouting.MapStaticAssets-scoped (.NET 9+) reminder aimed at readers troubleshooting "why aren't my default docs compressed?".ms.date; addedai-usage: ai-assistedundertitle.Both notes are self-contained; the second is intentionally shorter to minimize duplication while remaining discoverable in context.
Internal previews