How to serve Blazor WASM brotli files?

When publishing a Blazor WebAssembly website, the publish process creates .gz and .br files besides the .dll files for more performant serving. As in the screnshot:

Currently my Caddyfile looks like this:

localhost:5001 {
	encode zstd gzip
	try_files {path} /index.html
	file_server
}

What should I add to the Caddyfile so that caddy serves the already generated .br files by default?

You’re looking for the file_server directive’s precompressed option to enable this:

2 Likes

This topic was automatically closed after 30 days. New replies are no longer allowed.