You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The idea is to add grphql-Server side caching for most used queries.
e.g. for each homepage load, we don't need to execute the DB query (since the result would not change much),
So the Idea is to identify such queries implement server-side caching with configurable TTL and Cache-Control settings
Caching Backend
The cached queries are stored as query<->response key/value pairs, either in-memory or some external caching backend (e.g. Redis). In-memory caching is easy to setup and use for starters.
However, If we want to horizontally scale the graphql-server by running multiple instance of it, then using a external caching backend is more performant efficient (to which all the running instance of graphql server can connect)
Changes required
We will need to make changes to
graphql schema to add suitable cache directives to entities
subsquid's graphql-server/openreader packages to configure server-side caching
The idea is to add grphql-Server side caching for most used queries.
e.g. for each homepage load, we don't need to execute the DB query (since the result would not change much),
So the Idea is to identify such queries implement server-side caching with configurable
TTL
andCache-Control
settingsCaching Backend
The cached queries are stored as query<->response key/value pairs, either in-memory or some external caching backend (e.g. Redis). In-memory caching is easy to setup and use for starters.
However, If we want to horizontally scale the graphql-server by running multiple instance of it, then using a external caching backend is more performant efficient (to which all the running instance of graphql server can connect)
Changes required
We will need to make changes to
graphql-server
/openreader
packages to configure server-side cachingReference
https://www.apollographql.com/docs/apollo-server/performance/caching
The text was updated successfully, but these errors were encountered: