如何利用 cache 加快 seeker query 的時間
- reference
- 其實 HTTP spec 沒有限制 POST method 不能 cache,只是在 cache 的地方 (E.g. nginx) 要設定好
但是
- 意思是說幾乎全部的 cache 預設都不支援 POST
- 如何避免 URI 過長的問題?
-
persisted queries
-
https://github.com/apollographql/apollo-link-persisted-queries
-
在上面的 query,即便有共用 friends 的 name、birthday 欄位,依舊會被認為是不同的 query 而無法 cache
-
在彈性上做取捨
https://www.apollographql.com/docs/apollo-server/performance/caching/
demo
https://blog.techbridge.cc/2017/06/17/cache-introduction/
header 有了 Cache-Control 就能在上面不同的層級做 cache













