I've been attempting to get Microsoft.AspNetCore.ResponseCompression 2.1.1 working on a .net core project application that targets the .net full framework 472 to no avail.
I've stripped the project down to it's core leaving only:
public void ConfigureServices(IServiceCollection services)
{
services.AddResponseCompression(options =>
{
options.EnableForHttps = true;
});
}
public void Configure(IApplicationBuilder app)
{
app.UseResponseCompression();
app.UseStaticFiles();
}
I am trying to have the middleware compress a static file.
The request headers:
GET http://localhost:3721/css/Site.css HTTP/1.1
Host: localhost:3721
Connection: keep-alive
Accept: text/css
Accept-Encoding: gzip, deflate, br, *
The response headers:
HTTP/1.1 200 OK
Date: Sat, 03 Nov 2018 01:20:21 GMT
Content-Type: text/css
Server: Kestrel
Last-Modified: Thu, 13 Jul 2017 16:35:14 GMT
Accept-Ranges: bytes
ETag: "1d2fbf600bbcfda"
Vary: Accept-Encoding
Content-Length: 730
Is there anything glaringly wrong with my implementation that would cause the static file response headers to not echo:
content-encoding: gzip (or other)
Is it possible to hook into the method that decides whether to compress the request or not?