Skip to content

[Blazor] Add vary header to uncompressed endpoints #50246

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

Merged
merged 4 commits into from
Aug 14, 2025

Conversation

javiercn
Copy link
Member

@javiercn javiercn commented Aug 13, 2025

All the endpoints for a given route with multiple representations must have Vary applied to it.

@github-actions github-actions bot added the Area-AspNetCore RazorSDK, BlazorWebAssemblySDK, dotnet-watch label Aug 13, 2025
Copy link
Contributor

Thanks for your PR, @@javiercn.
To learn about the PR process and branching schedule of this repo, please take a look at the SDK PR Guide.

@javiercn javiercn force-pushed the javiercn/vary-header-on-uncompressed branch from d26840a to 1ac9995 Compare August 13, 2025 21:40
@javiercn javiercn marked this pull request as ready for review August 13, 2025 21:40
@Copilot Copilot AI review requested due to automatic review settings August 13, 2025 21:40
@javiercn javiercn requested a review from a team as a code owner August 13, 2025 21:41
@javiercn javiercn force-pushed the javiercn/vary-header-on-uncompressed branch from 1ac9995 to bd1d43a Compare August 13, 2025 21:41
@javiercn javiercn requested a review from MackinnonBuck August 13, 2025 21:41
Copy link
Contributor

@Copilot Copilot AI left a 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 adds a "Vary: Accept-Encoding" header to uncompressed static asset endpoints in Blazor WebAssembly applications. The change helps prevent caching issues where browsers might cache an uncompressed response and serve it even when compression is requested, improving HTTP caching behavior.

  • Updates static web asset endpoint configurations to include the Vary header
  • Applies to all uncompressed static assets like .dll, .js, .wasm, and other framework files
  • Changes are reflected in test baseline files to match the new behavior

Reviewed Changes

Copilot reviewed 13 out of 72 changed files in this pull request and generated no comments.

File Description
StaticWebAssets_PublishMinimal_Works.Publish.staticwebassets.json Updated baseline showing Vary header added to all uncompressed endpoints
StaticWebAssets_HostedApp_ReferencingNetStandardLibrary_Works.Build.staticwebassets.json Updated baseline showing Vary header added to all uncompressed endpoints
StaticWebAssets_Build_Hosted_Works.Build.staticwebassets.json Updated baseline showing Vary header added to all uncompressed endpoints

You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.

@javiercn javiercn requested a review from maraf August 13, 2025 22:21
@javiercn javiercn merged commit 209e114 into main Aug 14, 2025
27 checks passed
@javiercn javiercn deleted the javiercn/vary-header-on-uncompressed branch August 14, 2025 19:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-AspNetCore RazorSDK, BlazorWebAssemblySDK, dotnet-watch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants