-
Notifications
You must be signed in to change notification settings - Fork 10.4k
[Static Assets] Consume original-resource
instead of the Etag
#63379
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Static Assets] Consume original-resource
instead of the Etag
#63379
Conversation
/backport to release/10.0.1xx-rc2 |
Started backporting to release/10.0.1xx-rc2: https://github.com/dotnet/aspnetcore/actions/runs/17157590098 |
@javiercn an error occurred while backporting to "release/10.0.1xx-rc2", please check the run log for details! Error: The specified backport target branch "release/10.0.1xx-rc2" wasn't found in the repo. |
/backport to release/10.0-rc2 |
Started backporting to release/10.0-rc2: https://github.com/dotnet/aspnetcore/actions/runs/17157614755 |
@javiercn an error occurred while backporting to "release/10.0-rc2", please check the run log for details! Error: The specified backport target branch "release/10.0-rc2" wasn't found in the repo. |
/backport to release/10.0-rc1 |
Started backporting to release/10.0-rc1: https://github.com/dotnet/aspnetcore/actions/runs/17158160293 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR refactors how static asset descriptors are linked between compressed and uncompressed versions by replacing ETag-based lookup with an "original-resource" property. This change improves the reliability of finding the original asset for compressed variants during development.
Key changes:
- Replaced ETag-based linking with property-based linking using "original-resource" property
- Removed weak ETag handling and simplified ETag response headers
- Added descriptor mapping for efficient lookup during development
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
StaticAssetsIntegrationTests.cs | Updated test manifest creation to use "original-resource" property instead of weak ETag |
StaticAssetDevelopmentRuntimeHandler.cs | Refactored asset linking logic from ETag-based to property-based lookup with new descriptor mapping |
src/StaticAssets/src/Development/StaticAssetDevelopmentRuntimeHandler.cs
Show resolved
Hide resolved
/backport to release/10.0 |
Started backporting to release/10.0: https://github.com/dotnet/aspnetcore/actions/runs/17174851658 |
Paired with dotnet/sdk#50420
Fix ETag header not found error for compressed resources in Release builds
Description
When running ASP.NET Core applications with compressed static web assets in Release configuration, the runtime throws an
InvalidOperationException
with message "ETag header not found".We removed the additional ETag in production because some servers experience issues with it. For development, we switched to emit the ETag only in the Debug configuration.
The runtime however depended on the ETag being present for development scenarios and when we removed it, it started causing issues with
dotnet run -c Release
.The fix removes the usage of weak ETags for .NET 10.0 and onwards, replacing it with an
original-resource
endpoint property. The SDK will continue to emit weak ETags for .NET 9.0 for backwards compatibility.Fixes #63364