apollo-server/packages
Jesse Rosenberger 18d9041db7
Don't write to persisted query cache until execution will begin. (#2227)
Since we already write to the persisted query cache asynchronously (and
intentionally do not await the Promise) this won't have any affect on the
current behavior of when the persisted query cache is written to in the
event of an executable request, but if an operation comes in and doesn't
parse or validate, we'll avoid wasting cache space on an operation that will
never execute.

Additionally, in a similar light, if a plugin throws an error which stops
execution, we can avoid the side-effect of writing to the persisted query
cache.

In terms of the APQ behavior, while this could cause additional round-trips
for a client which repeatedly sends an invalid operation, that operation is
never going to successfully finish anyway.  While developer tooling will
help avoid this problem in the first place, this refusal to store an invalid
operation in the APQ cache could actually help diagnose a failure since the
full operation (rather than just the SHA256 of that document) will appear
in the browser's dev-tools on the retry.

If we're looking to spare parsing and validating documents which we know are
going to fail, I think that's going to be a better use of the (new)
`documentStore` cache (#2111), since its in-memory and can accommodate a
more complex data structure which includes the validation errors from the
previous attempt which will, of course, be the same when validating the same
operation against the same schema again.  As the PR that introduced that
feature shows, sparing those additional parses and validations (cached APQ
documents still needs to be parsed and validated, currently) will provide a
more successful performance win overall.

Ref: https://github.com/apollographql/apollo-server/pull/2111
2019-01-25 18:01:15 +02:00
..
apollo-cache-control Fix cache policy calculation when a hint has maxAge 0 (#2197) 2019-01-22 16:53:10 -05:00
apollo-datasource Publish 2018-11-26 20:43:29 +02:00
apollo-datasource-rest Publish 2018-11-26 20:43:29 +02:00
apollo-engine-reporting Publish 2018-12-13 15:29:53 +02:00
apollo-engine-reporting-protobuf Publish 2018-12-13 15:29:53 +02:00
apollo-server Publish 2018-12-13 21:07:29 +02:00
apollo-server-azure-functions Publish 2018-12-13 21:07:29 +02:00
apollo-server-cache-memcached nit: Use the term value rather than data for Key + *Value* stores. 2018-12-18 10:55:37 +02:00
apollo-server-cache-redis nit: Use the term value rather than data for Key + *Value* stores. 2018-12-18 10:55:37 +02:00
apollo-server-caching caching: InMemoryLRUCache support for ttl, much like Redis/Memcached. 2018-12-18 10:55:38 +02:00
apollo-server-cloud-functions Publish 2018-12-13 21:07:29 +02:00
apollo-server-cloudflare Publish 2018-12-13 21:07:29 +02:00
apollo-server-core Don't write to persisted query cache until execution will begin. (#2227) 2019-01-25 18:01:15 +02:00
apollo-server-env Publish 2018-11-07 08:17:21 -08:00
apollo-server-errors Publish 2018-11-07 08:17:21 -08:00
apollo-server-express chore(deps): update dependency @types/express to v4.16.1 (#2211) 2019-01-23 09:26:52 +00:00
apollo-server-hapi Publish 2018-12-13 21:07:29 +02:00
apollo-server-integration-testsuite Publish 2018-12-13 21:07:29 +02:00
apollo-server-koa Publish 2018-12-13 21:07:29 +02:00
apollo-server-lambda Publish 2018-12-13 21:07:29 +02:00
apollo-server-micro Publish 2018-12-13 21:07:29 +02:00
apollo-server-plugin-base Publish 2018-12-13 21:07:29 +02:00
apollo-server-testing Publish 2018-12-13 21:07:29 +02:00
apollo-tracing chore(deps): update dependency @types/graphql (#2187) 2019-01-16 04:30:31 +00:00
graphql-extensions chore(deps): update dependency @apollographql/apollo-tools to ^0.3.0 (#2190) 2019-01-17 04:22:44 +00:00