Restore --unsafely-treat-insecure-origin-as-secure flag for Blazor WASM Lighthouse scenario#2157
Merged
sebastienros merged 2 commits intoaspnet:mainfrom Mar 4, 2026
Conversation
sebastienros
reviewed
Mar 3, 2026
f8e913e to
9e09711
Compare
…SM Lighthouse scenario Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The WASM caching enforcement check previously only accepted HTTP 304 (Not Modified) as proof that a .wasm resource was cached. However, browsers may serve cached resources with HTTP 200 from disk/memory cache without making a network round-trip at all. Puppeteer exposes this via response.fromCache(). Both cases indicate the resource was properly cached after the first page load, so both should be accepted. Without this fix, the 'Second page load' step fails with: Unexpected uncached wasm resource '...System.Runtime.InteropServices.JavaScript.*.wasm' even though the resource is served from the browser cache. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
9e09711 to
aae2433
Compare
sebastienros
approved these changes
Mar 4, 2026
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.
Blazor WASM requires
crypto.subtle, which is only available in secure contexts (HTTPS or localhost). This restores the--unsafely-treat-insecure-origin-as-secureChromium flag so the Lighthouse benchmark can run against non-HTTPS targets.Original error:
See: https://dev.azure.com/dnceng/internal/_build/results?buildId=2916489&view=logs&j=11a54114-a913-5aee-3e37-a7e79dd06658&t=dce0fd39-734b-57d9-3c15-08dd4b8e31d5, "Blazor Web (WebAssembly)" or "Blazor Web (Auto)"
Further errors discovered when fixing the initial one:
build
At the time of adding the check for
response.status.wasmresources were not fingerprinted (#1944). They used stable filenames with ETag/Last-Modified caching, where the browser would always make a conditional request and get a 304. Since then, Blazor switched to fingerprinted filenames (e.g., *.xzugz00is9.wasm), which triggers Cache-Control: immutable — meaning the browser serves from cache directly (200 from cache) with no server round-trip, so 304 never occurs.Verification
AzDo build, job WebAssembly and Auto: build