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

Handler level plugins/middlewares (mocking, response-caching, rate limiting etc) #6030

Open
ardatan opened this issue Oct 2, 2023 · 3 comments

Comments

@ardatan
Copy link
Owner

ardatan commented Oct 2, 2023

In order to have mocking, response caching capabilities in the handler level

@ardatan ardatan changed the title Handler level plugins/middlewares Handler level plugins/middlewares (mocking, response-caching, rate limiting etc) Oct 2, 2023
@FGoessler
Copy link
Contributor

I started to play with the cache today and set up a file-cache as per the docs. I was surprised to see that the cache file does NOT get populated with any data.
We are using GraphQL as well as OpenAPI sources.

I would have expected that at least the OpenAPI-based sources would leverage the cache for HTTP header-based caching so we could reduce the load on our downstream source services.

If I read this issue and the GraphQL Mesh source code correctly, this use-case is not (yet ?) covered. Correct?

What would you recommend to do in the meantime? Can we inject a custom fetch handler and implement caching on that level ourselves or do you have any other recommended path? 🤔

@FGoessler
Copy link
Contributor

Actually, my bad. I should have seen this docu page earlier. 🙈

That actually seem to do what I am looking for. Sorry for the spam 😬

@ardatan
Copy link
Owner Author

ardatan commented Feb 13, 2024

Let's make things clear at first :)
There are cache storage implementations such as file, redis etc which defines WHERE you store the data. It doesn't define HOW things are cached.
There are plugins for this purpose; Response Caching, HTTP Caching etc to define HOW the data is cached.

This was referenced Apr 30, 2024
This was referenced May 7, 2024
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

2 participants