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

Clean up response compression #108

Closed Tratcher closed 7 years ago

Tratcher commented 7 years ago

Open items:

Testing:

Release:

muratg commented 7 years ago

Putting in 1.1.0 for now. We can move it to 1.2.0 if we can't finish this off in time.

Tratcher commented 7 years ago

GZipStream allocations: https://github.com/dotnet/corefx/issues/12549

muratg commented 7 years ago

@Tratcher Per PM decision, version numbers for new packages will be 1.0.0-preview1 for the initial release. (Not 1.1.0-preview1)

Tratcher commented 7 years ago

Review feedback:

Tratcher commented 7 years ago

Reading from config works pretty well:

{
  "section": {
    "EnableForHttps": true,
    "MimeTypes": ["text/plain", "text/html"]
  }
}
            services.AddResponseCompression(options =>
            {
                Configuration.GetSection("section").Bind(options);
            });
Tratcher commented 7 years ago

Possible default mime types (things used by the template, static files): text/css text/html application/javascript

WebApi: application/xml text/xml application/json text/json application/json-patch+json

Other: text/plain

Yves57 commented 7 years ago

Maybe adding "image/svg+xml" to the default types.

Tratcher commented 7 years ago

@Yves57 justification? We're not trying to capture every possible type, just the ones to make the 90% scenario work. I based this list on the files included in the full WebApp template, as well as those types from MVC/WebAPI.

Tratcher commented 7 years ago

Closing this now that we've worked through the main checklists. Further questions, feedback, etc. should be filed in new issues.

Yves57 commented 7 years ago

@Tratcher Because SVG is a standard included in W3C recommandations. So I don't think it's "exotic"...