aspnet / BasicMiddleware

[Archived] Basic middleware components for ASP.NET Core. Project moved to https://github.com/aspnet/AspNetCore
Apache License 2.0
169 stars 84 forks source link

Compression: Vary Header not returned when content gzipped #187

Closed spboyer closed 7 years ago

spboyer commented 7 years ago

Response header should contain

Vary: Accept-Encoding

when content is gzipped. IIS compression currently adds header.

Tratcher commented 7 years ago

There's some debate over who should be setting this. Right now the cache headers are set by the resource (e.g. the ResponseCache attribute on the MVC action).

I guess you could consider this an opt-out header and compare it to the CookieAuth middleware always opting out of all caching.

Does IIS add the Vary even for non-cacheable responses?

spboyer commented 7 years ago

My understanding, would need confirmation from IIS team, is that if the Accept-Encoding header is sent then IIS responds with the Vary, otherwise no.