Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cache successfully parsed and validated documents for future requests. #2111

Merged
merged 15 commits into from Jan 23, 2019

Commits on Dec 18, 2018

  1. Configuration menu
    Copy the full SHA
    b30e933 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    88a294b View commit details
    Browse the repository at this point in the history
  3. Publish

     - apollo-cache-control@0.5.0-alpha.0
     - apollo-datasource-rest@0.3.0-alpha.0
     - apollo-datasource@0.3.0-alpha.0
     - apollo-engine-reporting@0.3.0-alpha.0
     - apollo-server-azure-functions@2.4.0-alpha.0
     - apollo-server-cache-memcached@0.3.0-alpha.0
     - apollo-server-cache-redis@0.3.0-alpha.0
     - apollo-server-caching@0.3.0-alpha.0
     - apollo-server-cloud-functions@2.4.0-alpha.0
     - apollo-server-cloudflare@2.4.0-alpha.0
     - apollo-server-core@2.4.0-alpha.0
     - apollo-server-express@2.4.0-alpha.0
     - apollo-server-hapi@2.4.0-alpha.0
     - apollo-server-integration-testsuite@2.4.0-alpha.0
     - apollo-server-koa@2.4.0-alpha.0
     - apollo-server-lambda@2.4.0-alpha.0
     - apollo-server-micro@2.4.0-alpha.0
     - apollo-server-plugin-base@0.3.0-alpha.0
     - apollo-server-testing@2.4.0-alpha.0
     - apollo-server@2.4.0-alpha.0
     - apollo-tracing@0.5.0-alpha.0
     - graphql-extensions@0.5.0-alpha.0
    abernix committed Dec 18, 2018
    Configuration menu
    Copy the full SHA
    7697623 View commit details
    Browse the repository at this point in the history

Commits on Jan 14, 2019

  1. Configuration menu
    Copy the full SHA
    ea7da3a View commit details
    Browse the repository at this point in the history

Commits on Jan 15, 2019

  1. Configuration menu
    Copy the full SHA
    45f14a2 View commit details
    Browse the repository at this point in the history
  2. Ensure requestContext.document set, irregardless of documentStore

    … use.
    
    Without this change, the `document` property was not set on the
    `requestContext` for consumption by request pipeline plugins.
    
    To further guard against this oversight, I've removed the extra `document`
    variable which was being used as scoped state for the document and switched to
    directly using (and assigning to) the `requestContext.document`.
    
    Nice catch, @glasser!
    
    Ref: https://github.com/apollographql/apollo-server/pull/2111/files#r247617469
    abernix committed Jan 15, 2019
    Configuration menu
    Copy the full SHA
    f33ae19 View commit details
    Browse the repository at this point in the history
  3. Clarify comments surrounding documentStore, which led to confusion.

    The parsed/validated cache store is on by default.  While it could be disabled,
    in theory, it cannot be disabled since its an internal property of the
    request pipeline processor class.
    
    See confusion here:
    
      withspectrum/spectrum#4533 (comment)
    abernix committed Jan 15, 2019
    Configuration menu
    Copy the full SHA
    2652057 View commit details
    Browse the repository at this point in the history
  4. Fix typos/spacing in commentary.

    Of my own making!
    abernix committed Jan 15, 2019
    Configuration menu
    Copy the full SHA
    f546086 View commit details
    Browse the repository at this point in the history
  5. Guard against (currently impossible) failure to read from `documentSt…

    …ore`.
    
    While the implementation of the `documentStore` is currently simple enough
    to never throw (it is in-memory), it makes some sense to guard against future
    extended functionality where an exception might be raised.
    
    Since storing this object in a distributed memory store isn't currently
    feasible, I'm not sure what such an exception would be right now, but I
    don't mind being proactive!
    
    Ref: https://github.com/apollographql/apollo-server/pull/2111/files#r247618501
    abernix committed Jan 15, 2019
    Configuration menu
    Copy the full SHA
    1a9d65d View commit details
    Browse the repository at this point in the history
  6. Be considerate of variable length utf-8 encodings in InMemoryLRUCache.

    Previously, this used the `JSON.stringify` length, but this is slightly more
    aware.
    abernix committed Jan 15, 2019
    Configuration menu
    Copy the full SHA
    0879a12 View commit details
    Browse the repository at this point in the history

Commits on Jan 16, 2019

  1. Shift the burden of object approximation into the ApolloServerBase

    …class.
    
    The implementation of object-size approximation which is used for cache
    eviction purposes in the `InMemoryLRUCache` implementation (via `lru-cache`)
    was a short-term location for extensible logic which is better located
    within `ApolloServerBase`.
    
    This is particularly important since future logic may necessitate knowing or
    understanding the current size (roughly, memory usage) of the in-memory
    storage.  Effective immediately, this adds support for providing a `dispose`
    function which is called when an object is purged from the cache to make
    room for another.
    abernix committed Jan 16, 2019
    Configuration menu
    Copy the full SHA
    be71620 View commit details
    Browse the repository at this point in the history
  2. [debug] Print out documentStore stats every 60 seconds.

    In an effort to see how effective this cache is in production during this
    alpha phase, we'll print out the stats on the document store every 60
    seconds.
    abernix committed Jan 16, 2019
    Configuration menu
    Copy the full SHA
    7a0d0e6 View commit details
    Browse the repository at this point in the history
  3. Publish

     - apollo-cache-control@0.5.0-alpha.1
     - apollo-datasource-rest@0.3.0-alpha.1
     - apollo-datasource@0.3.0-alpha.1
     - apollo-engine-reporting@0.3.0-alpha.1
     - apollo-server-azure-functions@2.4.0-alpha.1
     - apollo-server-cache-memcached@0.3.0-alpha.1
     - apollo-server-cache-redis@0.3.0-alpha.1
     - apollo-server-caching@0.3.0-alpha.1
     - apollo-server-cloud-functions@2.4.0-alpha.1
     - apollo-server-cloudflare@2.4.0-alpha.1
     - apollo-server-core@2.4.0-alpha.1
     - apollo-server-express@2.4.0-alpha.1
     - apollo-server-hapi@2.4.0-alpha.1
     - apollo-server-integration-testsuite@2.4.0-alpha.1
     - apollo-server-koa@2.4.0-alpha.1
     - apollo-server-lambda@2.4.0-alpha.1
     - apollo-server-micro@2.4.0-alpha.1
     - apollo-server-plugin-base@0.3.0-alpha.1
     - apollo-server-testing@2.4.0-alpha.1
     - apollo-server@2.4.0-alpha.1
     - apollo-tracing@0.5.0-alpha.1
     - graphql-extensions@0.5.0-alpha.1
    abernix committed Jan 16, 2019
    Configuration menu
    Copy the full SHA
    33d1f82 View commit details
    Browse the repository at this point in the history

Commits on Jan 23, 2019

  1. Revert (as intended!) "[debug] Print out documentStore stats every 60…

    … seconds."
    
    This reverts commit 7a0d0e6, as I intended
    when I originally introduced it.
    
    Ref: #2111 (comment)
    abernix committed Jan 23, 2019
    Configuration menu
    Copy the full SHA
    2ed1c0e View commit details
    Browse the repository at this point in the history
  2. Publish

     - apollo-server-azure-functions@2.4.0-alpha.2
     - apollo-server-cloud-functions@2.4.0-alpha.2
     - apollo-server-cloudflare@2.4.0-alpha.2
     - apollo-server-core@2.4.0-alpha.2
     - apollo-server-express@2.4.0-alpha.2
     - apollo-server-hapi@2.4.0-alpha.2
     - apollo-server-integration-testsuite@2.4.0-alpha.2
     - apollo-server-koa@2.4.0-alpha.2
     - apollo-server-lambda@2.4.0-alpha.2
     - apollo-server-micro@2.4.0-alpha.2
     - apollo-server-plugin-base@0.3.0-alpha.2
     - apollo-server-testing@2.4.0-alpha.2
     - apollo-server@2.4.0-alpha.2
     - graphql-extensions@0.5.0-alpha.2
    abernix committed Jan 23, 2019
    Configuration menu
    Copy the full SHA
    1d00219 View commit details
    Browse the repository at this point in the history