improve cache.json generation implementation (reduce duplicated grapqhl calls in serialization workflow) #272
Labels
Content as Data
enhancement
Improve something existing (e.g. no docs, new APIs, etc)
Plugins
Greenwood Plugins
Milestone
Type of Change
Summary
Technical debt tracking for some of the issue rough and dirty technical design decisions made as part of implementing #115 .
Details
The way cache.json data gets written is a little convoluted since each request needs to be done twice before it can get written as cache.json as part of the build / serialization lifecycle.
createCache
createCache
then instantiates an instance of Apollo client and makes a call back to the GraphQL serverThis seems cumbersome and will likely not scale well? Or just seems slow. It would be great if on the response handler of the GraphQL server could handle writing to disk, or at least avoiding the duplicate query call, which has required us to do this or else we will get stuck in an infinite loop.
Ideally, we could use some form of memoization so duplicated queries for a specific route subset are not repeated, which would certainly help with performance. This kind of caching improvement (memoization) could / should also applies to client.js as well to avoid unnecessary
fetch
calls.The text was updated successfully, but these errors were encountered: