Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cache control plugin: set
cache-control: no-store
by default (#6986)
As pointed out in #2605, browsers cache many GET requests by default, so "not cacheable" shouldn't be the same as "don't set a cache-control header". This PR makes the backwards-incompatible change to the cache control plugin to make it always set the cache-control header to something if it is enabled (with calculateHttpHeaders not set to false), perhaps `no-store`. (If some other plugin or error already set the header, it does not override it with `no-store`.) To restore AS3 behavior: ApolloServerPluginCacheControl({ calculateHttpHeaders: 'if-cacheable' }) Fixes #2605.
- Loading branch information
Showing
7 changed files
with
112 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
'@apollo/server-integration-testsuite': patch | ||
'@apollo/server': patch | ||
--- | ||
|
||
The cache control plugin sets `cache-control: no-store` for uncacheable responses. Pass `calculateHttpHeaders: 'if-cacheable'` to the cache control plugin to restore AS3 behavior. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters