Skip to content

HTTP configuration: make compression configurable via middleware extensions #13228

Open
@jmacd

Description

@jmacd

Discussed in #13051 (comment), connected with #7441, we have evidence that existing hard-coded parts of confighttp should be instead configured via middleware. In particular, we observe that rate-limiting is sometimes desirable via middleware both before and after the compression middleware (for network bytes and request count/bytes, respectively).

As for how this could be done -- here are some ideas:

At least one feature flag will be required.

Presently compression settings are built-in to both configgrpc and confighttp for standard codecs. We can keep standard settings in place by registering synthetic middlewares with names such as "compression" and "decompression" which, when inserted into the middlewares, cause the standard configuration to be used.

Ideally users are able to experiment with alternative compression codecs by registering alternative middleware, especially for clients. With the feature on, we should be able to name a compression extension instead of using a built-ins.

For servers, which typically handle multiple codecs, it's typical to register a static list of codecs. For gRPC this is already supported, extensions are able to register gRPC compression codecs. We could extend the server's CompressionAlgorithms field to recognize middleware extensions by name.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions