-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement EntityStore#makeCacheKey to simplify result caching.
Although all the components of a key returned by makeCacheKey are important, there's usually one that "anchors" the rest, because it survives the longest and changes the least. In the case of the result caching system, the current EntityStore object is that anchor. This commit formalizes that anchoring role by making the EntityStore literally responsible for generating cache keys based on query AST objects, variables, and other frequently changing inputs. Especially given the recent introduction of CacheGroup logic, it's easier to reason about the makeCacheKey functions if we put part of their implementation behind an abstraction. This abstraction also means we no longer need to pass a KeyTrie into the StoreReader and StoreWriter constructors, as the KeyTrie (context.store.group.keyMaker) now resides within the EntityStore, which is provided as part of the ExecContext (context.store).
- Loading branch information
Showing
3 changed files
with
30 additions
and
44 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
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