scaife-viewer / backend

Packages and utilities to build Scaife Viewer backends using ATLAS / CTS resolvers
3 stars 2 forks source link

Document caching approaches for GraphQL requests #18

Open jacobwegner opened 4 years ago

jacobwegner commented 4 years ago

SV 1 sites can leverage http caching layers such as Varnish / Fastly, because most of the requests are method:GET.

By default, Apollo asumes method:POST requests. We might be able to just switch to GET within Apollo and tune the Varnish configs at the graphql endpoint, but we might be working against some querystring lenght limitations on Fastly.

It might also be possible to cache POST requests just at that GraphQL endpoint, but we may even prefer an explicit cacheable endpoint / disallow caching of requests that use mutations or actually vary on a user cookie.

Possibly related to upgrading Apollo (https://github.com/scaife-viewer/frontend/issues/12)

jacobwegner commented 4 years ago

This is another option, but likely would be a bit more cumbersome given how we're building out the frontends:

https://www.apollographql.com/docs/apollo-server/performance/apq/