Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add output cache for VaryByValue #559

Open
64J0 opened this issue Oct 7, 2023 · 0 comments
Open

Add output cache for VaryByValue #559

64J0 opened this issue Oct 7, 2023 · 0 comments

Comments

@64J0
Copy link
Member

64J0 commented Oct 7, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant