Custom Compression Provider is not being triggered
See original GitHub issueI created a new Core API Project and I had the Interface and class for custom compression as it states here:
Then in my Startup.cs class I have the following:
services.AddGrpc().AddServiceOptions<GreeterService>(options =>
{
options.ResponseCompressionLevel = System.IO.Compression.CompressionLevel.Optimal;
options.ResponseCompressionAlgorithm = "gzip";
options.CompressionProviders = new List<ICompressionProvider>();
});
Then I set a few breakpoints just to see if the new provider is being hit without any success:
Any clue on how to make this work? Thanks
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (2 by maintainers)
Top Results From Across the Web
Response compression in ASP.NET Core
The response compression middleware allows adding additional compression providers for custom Accept-Encoding header values.
Read more >Net core 1.1 UseResponseCompression isn't compressing
I think you need to specify the compression provider. Try this: services.AddResponseCompression(options => { options.Providers.
Read more >Response Compression In ASP.NET Core - Milan Jovanović
You can further customize the available providers by adding custom compression providers if you want to. Compression will default to Brotli ...
Read more >How to Enable GZIP Compression for Faster Web Pages
Learn how GZIP compression works to deliver web pages to browsers more quickly, and how to activate it on your web server.
Read more >Express compression middleware
This middleware will never compress responses that include a Cache-Control header with the no-transform directive, as compressing will transform the body.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The way I solve it was to add the following code:
And my custom Gzip compression for now is exactly as the GzipCompressionProvider.
How did you solve it? Thanks