BlazorWorker
BlazorWorker copied to clipboard
Replace XMLHttpRequest with fetch to hook on cache
The following code mirrors an old version of the blazor assembly loader https://github.com/Tewr/BlazorWorker/blob/ef8039f905cda29799d1c60be5c7da15fb93e9b5/src/BlazorWorker/BlazorWorker.js#L40
The "new" (3.2.0?) version of blazor uses resource caching with fetch (service worker?), this should be mirrored in BlazorWorker to take advantage of request caching, has the potential to speed up worker initialization down to 0 requests for most cases.
not sure if practically feasable to hook on to the cache used here: https://github.com/dotnet/aspnetcore/blob/7a9707eb98c9e82d2fdbc25de541bf60d4bb46ca/src/Components/Web.JS/src/Platform/WebAssemblyResourceLoader.ts#L77 but certainly worth an investigation
This part should also profit from a build-time created list of assembly-dll maps, to avoid problems like the ones in #64