Skip to content

Add output cache for VaryByValue #559

Description

@64J0

Description:

We currently have the following possible cache middlewares on Giraffe:

  • publicResponseCaching: Varies by headers;
  • privateResponseCaching: Varies by headers;
  • noResponseCaching;
  • responseCaching: Varies by headers and query parameters.

In order to improve the project, we must add a new middleware, that let the cache vary by some value on the route endpoint.

For example, suppose we have this endpoint:

GET >=> routef "/pessoas/%s" // ...

The value of %s will change from request to request, but it could be useful to keep the response cached for a while in some cases that the value is the same.


I got this idea when studying this project: https://github.com/andr3marra/rinha-de-backend-2023-q3-csharp/blob/main/src/Program.cs#L85.

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature requestRequest to add new functionality

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions