Skip to content

Commit 5aab30b

Browse files
smyrickMeschreiber
andauthored
Update docs/source/routing/performance/caching/in-memory.mdx
Co-authored-by: Maria Elisabeth Schreiber <maria.schreiber@apollographql.com>
1 parent f8791f2 commit 5aab30b

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

docs/source/routing/performance/caching/in-memory.mdx

+7-5
Original file line numberDiff line numberDiff line change
@@ -80,16 +80,18 @@ then look at `apollo.router.schema.loading.time` and `apollo.router.query_planni
8080

8181
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.
8282

83+
<MinVersion version="1.61.0">
84+
8385
#### Cache warm-up with headers
8486

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>
8688

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:
9090

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.
9293

94+
This lets you warm up query plan caches with real, mirrored, or similar to production operations before transitioning traffic to new router instances.
9395
## Caching automatic persisted queries (APQ)
9496

9597
[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

Comments
 (0)