-
Notifications
You must be signed in to change notification settings - Fork 10.1k
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
[Blazor WebAssembly standalone] Don't cache index.html
during development
#59340
Conversation
@@ -40,7 +40,10 @@ | |||
<_FrameworkStaticWebAssetCandidate Remove="@(_MissingFrameworkStaticWebAssetCandidate)" /> | |||
</ItemGroup> | |||
|
|||
<Message Importance="High" Text="Framework asset '%(_MissingFrameworkStaticWebAssetCandidate.Identity)' could not be found and won't be included in the project." /> | |||
<Message |
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.
This is unrelated to the main fix - it was logging a message even when _MissingFrameworkStaticWebAssetCandidate
was empty.
/backport to release/9.0 |
Started backporting to release/9.0: https://github.com/dotnet/aspnetcore/actions/runs/12188138898 |
@MackinnonBuck backporting to release/9.0 failed, the patch most likely resulted in conflicts: $ git am --3way --empty=keep --ignore-whitespace --keep-non-patch changes.patch
Applying: Don't cache index.html when running via Dev Sever
Using index info to reconstruct a base tree...
A src/Assets/build/Microsoft.AspNetCore.App.Internal.Assets.targets
M src/Components/WebAssembly/DevServer/src/Server/Startup.cs
M src/Components/WebView/WebView/src/build/Microsoft.AspNetCore.Components.WebView.props
Falling back to patching base and 3-way merge...
Auto-merging src/Components/WebView/WebView/src/build/Microsoft.AspNetCore.Components.WebView.props
CONFLICT (content): Merge conflict in src/Components/WebView/WebView/src/build/Microsoft.AspNetCore.Components.WebView.props
Auto-merging src/Components/WebAssembly/DevServer/src/Server/Startup.cs
CONFLICT (modify/delete): src/Assets/build/Microsoft.AspNetCore.App.Internal.Assets.targets deleted in HEAD and modified in Don't cache index.html when running via Dev Sever. Version Don't cache index.html when running via Dev Sever of src/Assets/build/Microsoft.AspNetCore.App.Internal.Assets.targets left in tree.
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
hint: When you have resolved this problem, run "git am --continue".
hint: If you prefer to skip this patch, run "git am --skip" instead.
hint: To restore the original branch and stop patching, run "git am --abort".
hint: Disable this message with "git config advice.mergeConflict false"
Patch failed at 0001 Don't cache index.html when running via Dev Sever
Error: The process '/usr/bin/git' failed with exit code 128 Please backport manually! |
[Blazor WebAssembly standalone] Don't cache
index.html
during developmentFixes an issue where the WebAssembly dev server (used during Blazor WebAssembly standalone development) returned
index.html
with incorrect caching headers, resulting in hot reload script injection sometimes being bypassed.Description
The fix is to add the
Cache-Control: no-store
header to the response forindex.html
when running the app via the WebAssembly dev server. This prevents the browser from using a cached response, which bypasses the script injection middleware.Fixes #59276