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
Copy file name to clipboardExpand all lines: docs/source/routing/performance/caching/in-memory.mdx
+7-5
Original file line number
Diff line number
Diff line change
@@ -80,16 +80,18 @@ then look at `apollo.router.schema.loading.time` and `apollo.router.query_planni
80
80
81
81
If the router is using distributed caching for query plans, the warm-up phase will also store the new query plans in Redis. Since all Router instances might have the same distributions of queries in their in-memory cache, the list of queries is shuffled before warm-up, so each Router instance can plan queries in a different order and share their results through the cache.
82
82
83
+
<MinVersion version="1.61.0">
84
+
83
85
#### Cache warm-up with headers
84
86
85
-
With [the Apollo Router Core](https://github.com/apollographql/router) v1.61.0+ or v2.x+, you can pass the following header to return the query plans in the GraphQL response extensions:
87
+
</MinVersion>
86
88
87
-
- The header `Apollo-Expose-Query-Plan` must be set with one of the following options:
88
-
- A value of `true` returns a human-readable string and JSON blob of the query plan
89
-
- A value of `dry-run` will generate the query plan and then abort execution. This can be helpful if you want to warm up any internal or external query plan caches as after generation it will save it to your configured cache locations as normal.
89
+
With router v1.61.0+ and v2.x+, you can pass the `Apollo-Expose-Query-Plan` header to return query plans in the GraphQL response extensions. You must set the header to one of the following values:
90
90
91
-
This will allow you to warm up cache instances with real, mirrored, or similar to production operations that you direct to the Router before you move traffic to new instances.
91
+
- `true`: Returns a human-readable string and JSON blob of the query plan.
92
+
- `dry-run`: Generates the query plan without executing the query. After generation, query plans are saved to your configured cache locations, making it useful for pre-warming internal or external caches.
92
93
94
+
This lets you warm up query plan caches with real, mirrored, or similar to production operations before transitioning traffic to new router instances.
93
95
## Caching automatic persisted queries (APQ)
94
96
95
97
[Automatic Persisted Queries (**APQ**)](/apollo-server/performance/apq/) enable GraphQL clients to send a server the _hash_ of their query string, _instead of_ sending the query string itself. When query strings are very large, this can significantly reduce network usage.
0 commit comments