4 ms·
It's just a GET request. Same as REST. I don't know what you want me to show as an example. You can use Apache, nginx, squid, any proxying webserver worth its s
by RedShift1 4y ago
It's just a GET request. Same as REST. I don't know what you want me to show as an example. You can use Apache, nginx, squid, any proxying webserver worth its salt...
- arinlen 4y ago> It's just a GET request. Same as REST. I'm not sure you understand the problem at all. Are you actually able to show an example or not? Because changing the HTTP verb doesn't magically change the problem, and passing query parameters as a request document renders these queries uncacheable. > You can use Apache, nginx, squid, any proxying webserver worth its salt... Great, pick the one you're familiar with, and just show the code. Well, unless you're not "worth its salt" or are completely oblivious to the problem domain.
- RedShift1 4y agoCheck back in a couple of hours, I'm on my mobile right now
- Xenoamorphous 4y agoA GET request is a GET request and anything that can cache one doesn’t know or care whether it’s for REST, GraphQL, a binary file or anything else.
- RedShift1 4y agoHere's the code: https://github.com/RedShift1/graphql-cached-get https://github.com/RedShift1/graphql-cached-get Note that I made a very primitive implementation. Depending on which GraphQL node is queried, the request will be cached by the proxy or not. Apollo GraphQL server has much more fine grained methods of allowing caching (see https://www.apollographql.com/docs/apollo-server/performance/caching/ https://www.apollographql.com/docs/apollo-server/performance...) however I left the example code crude so you see exactly what's going on under the hood.