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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature requestRequest to add new functionality

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions