Skip to content

Optimize compressible content selection #744

@Kaliumhexacyanoferrat

Description

@Kaliumhexacyanoferrat

As a developer of a web application, I would like content that can be compressed well automatically be compressed by the server.

Example

Currently we check for a number of content types. Users should be allowed to extend this logic to their needs, e.g. via

CompressedContent.Default()
                 .Selector((IRequest req, IResponse resp) => true/false);

Could also use the existing logic as a fallback (e.g. via CompressedContent.DefaultSelector()), but this should be documented then. Besides this, the following adjustments to the default logic should be added:

  • Remove the .rrd part, this can be custom
  • Remove WOFF variants, as they are already compressed
  • Add application/xml,
  • Move to logic instead of a list for +json and +xml and maybe for all text/ and font/* (except woff)

Acceptance criteria

  • The rules have been adjusted as described above
  • The feature is documented on the GenHTTP website
  • The feature is covered by acceptance tests

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions