Caching options on connected APIs #61
-
I just discovered wundergraph and it looks really awesome, plus the website describes the features so well. Thanks for that. One thing I haven't found yet is an explanation how caching works between wundergraph and the remote APIs. const operations: ConfigureOperations = {
...
queries: config => {
return {
...config,
kind: "query",
caching: {
enable: false,
public: true,
maxAge: 10,
staleWhileRevalidate: 5,
},
liveQuery: {
enable: false,
pollingIntervalSeconds: 5,
}
}
},
...
custom: {
Countries: enableCaching,
TopProducts: config => ({
...config,
caching: {
...config.caching,
enable: true
},
}),
Users: config => ({
...config,
caching: {
...config.caching,
enable: true,
maxAge: 120,
}
}),
}
} I guess these configs set the caching behavior between clients and wundergraph. But what about the caching between wundergraph and APIs? Especially when using live queries... |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
@chris-schra You're right in that this configuration defines the HTTP caching behaviour between WunderGraph server and clients. Currently, there's no caching happening between WunderGraph server and origin, although it would be simple to add. Regarding live queries and origin caching, how could this help in your use case? Can you describe a bit more what you're trying to do? |
Beta Was this translation helpful? Give feedback.
@chris-schra You're right in that this configuration defines the HTTP caching behaviour between WunderGraph server and clients.
Currently, there's no caching happening between WunderGraph server and origin, although it would be simple to add.
E.g. the transport we're using to talk to the origins could easily support caching too.
It's just not something that anybody asked for, yet.
Regarding live queries and origin caching, how could this help in your use case? Can you describe a bit more what you're trying to do?