-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Description
Is there an existing issue for this?
- I have searched the existing issues
Describe the bug
I'm not sure at what point in time this has started occurring as I'm sure this has worked in the past, but I'm not longer seeing content being compressed with response compression enabled, whether that's trying to test the issue locally or when published.
In my browser tools against my published application, I'm seeing no difference between transferred over the network and resource size, with 'Content-Encoding' column being blank:
I can see in the request that it's sending the right 'Accept-Encoding' request headers:
As a test I've tried publishing my application locally on disk, and in the output I can see *.js.br and *.js.gz files that are well compressed, so it's producing the compressed output, I don't know why it's not being served up.
My Application is a Blazor Web App on .NET 9, built on .NET Aspire, published to Azure Container apps through azd.
Expected Behavior
I would expect to see a reduced size transferred over the network and 'Content-Encoding' column populated.
Steps To Reproduce
I have response compression added to my services, I've added the compression options here to see if it makes a difference but no change:
builder.Services.AddResponseCompression(static options =>
{
options.EnableForHttps = true;
options.Providers.Add<BrotliCompressionProvider>();
options.Providers.Add<GzipCompressionProvider>();
// For signalR
options.MimeTypes = [.. ResponseCompressionDefaults.MimeTypes, "application/octet-stream"];
});
builder.Services.Configure<BrotliCompressionProviderOptions>(options => options.Level = CompressionLevel.Optimal);
builder.Services.Configure<GzipCompressionProviderOptions>(options => options.Level = CompressionLevel.Optimal);and
app.UseResponseCompression();Early on in my app configuration (in the case of my web app, before 'app.MapStaticAssets(), and 'MapRazorComponents' or anything else).
Exceptions (if any)
None I've seen, it just doesn't work.
.NET Version
9.0.202
Anything else?
.NET 9, Aspire 9.1, published through Azure DevOps with the latest version of azd to Azure container apps.

