Skip to content
Discussion options

You must be logged in to vote

yeah you re right - the default bootstrapper doesn t ask for .gz files on its own. but it s easy to fix. you just override the loadBootResource function in your index.html

basically you intercept how the files load and add .gz to the end of the URL. that way the browser requests the compressed file directly and cloudflare s size limit won t be a problem anymore

here s a quick example:

<script src="_framework/blazor.webassembly.js" autostart="false"></script>
<script>
  Blazor.start({
    loadBootResource: function (type, name, defaultUri, integrity) {
      if (type === 'dotnetjs' || type === 'dotnetwasm' || type === 'assembly') {
        return `${defaultUri}.gz`;
      }
    }
  });
</s…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@SerratedSharp
Comment options

Answer selected by SerratedSharp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants