BlazorWorker icon indicating copy to clipboard operation
BlazorWorker copied to clipboard

Replace XMLHttpRequest with fetch to hook on cache

Open Tewr opened this issue 4 years ago • 1 comments

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

Tewr avatar Jul 30 '20 07:07 Tewr

This part should also profit from a build-time created list of assembly-dll maps, to avoid problems like the ones in #64

Tewr avatar Aug 27 '21 11:08 Tewr