Skip to content

Commit f6ca809

Browse files
authored
Add Priority metadata (#36577)
1 parent e06c515 commit f6ca809

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

aspnetcore/fundamentals/static-files.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ description: Learn how to serve and secure static files and configure Map Static
55
monikerRange: '>= aspnetcore-3.1'
66
ms.author: wpickett
77
ms.custom: mvc
8-
ms.date: 09/17/2025
8+
ms.date: 01/05/2026
99
uid: fundamentals/static-files
1010
---
1111
# Static files in ASP.NET Core
@@ -1123,7 +1123,7 @@ Property | Description
11231123

11241124
Item group | Description | Metadata
11251125
--- | ---
1126-
`StaticWebAssetContentTypeMapping` | Maps file patterns to content types and cache headers for endpoints. | `Pattern`, `Cache`
1126+
`StaticWebAssetContentTypeMapping` | Maps file patterns to content types and cache headers for endpoints. | `Pattern`, `Cache`, `Priority`
11271127
`StaticWebAssetFingerprintPattern` | Defines patterns for applying fingerprints to static web assets for cache busting. | `Pattern`, `Expression`
11281128

11291129
Metadata Descriptions:
@@ -1132,13 +1132,16 @@ Metadata Descriptions:
11321132

11331133
* **`Cache`**: Specifies the `Cache-Control` header value for the matched content type. This controls browser caching behavior (for example, `max-age=3600, must-revalidate` for media files).
11341134

1135+
* **`Priority`**: Controls precedence when multiple `StaticWebAssetContentTypeMapping` items match the same file. Higher numeric values take precedence over lower ones. `Priority` is required.
1136+
11351137
* **`Expression`**: Defines how the fingerprint is inserted into the filename. The default is `#[.{FINGERPRINT}]`, which inserts the fingerprint (`{FINGERPRINT}` placeholder) before the extension.
11361138

11371139
The following example maps the bitmap file pattern (`.bmp`) to the `image/bmp` content type with the `{CACHE HEADER}` placeholder representing the `Cache-Control` header to use for non-fingerprinted endpoints:
11381140

11391141
```xml
11401142
<ItemGroup>
1141-
<StaticWebAssetContentTypeMapping Include="image/bmp" Cache="{CACHE HEADER}" Pattern="*.bmp" />
1143+
<StaticWebAssetContentTypeMapping Include="image/bmp" Cache="{CACHE HEADER}"
1144+
Pattern="*.bmp" Priority="1" />
11421145
</ItemGroup>
11431146
```
11441147

0 commit comments

Comments
 (0)