-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Deterministically resolve the "auto" render mode to "server" or "webassembly" #49580
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
Comments
|
@pavelsavara I wonder if |
Yes, you can do that. The runtime is awaiting a result of the This way you could keep the bandwidth for the rest of the server page to load first. You will need to perf-test that to know if that's good idea. |
I had a brief discussion with @SteveSandersonMS and @javiercn this morning about the pros and cons of relying on
I think the biggest unknown here is the level of accuracy that the hashing approach gives us. From how I understand the problem, the concerns around why the approach is only a "best guess" are that:
I don't think concern 1 is an issue because if we relied on all resources being cached, we might never resolve auto mode to WebAssembly (e.g., maybe the developer deliberately added request headers to disable caching for specific resources). I think it's generally fine and expected that Blazor WebAssembly will be used after WebAssembly resources have loaded at least once and we've cached as much as we can. Regarding concern 2, I don't think there will ever be a case where we have a matching resource hash, but a subset (or all) WebAssembly resources have been evicted from the cache. The MDN Web Docs suggest that when browsers evict an origin's data, they evict all the data at once to avoid "inconsistency problems". From this, I believe we can derive that if WebAssembly resources are cleared, so will the Therefore, my proposal is that we go with the approach that relies on Thoughts? Did I miss anything? |
This sounds like a reasonable tradeoff to me. It sounds like the failure modes would be:
Both of these are not as ideal as if we had a real way to check what is cached, so if we were retaining the I'm OK with either:
|
At that point we have the But not inventory of the HTTP cache. Let's go with |
Currently, when the first component with an "auto" render mode is added to the page, we use a timeout-based mechanism to make a guess about whether WebAssembly resources are cached. This is because information about which resources are already cached is not yet exposed by
dotnet.js
. In order for the render mode to be resolved deterministically, we'll needdotnet.js
to expose that information to Blazor.The text was updated successfully, but these errors were encountered: