optimizely / nuclear-js

Reactive Flux built with ImmutableJS data structures. Framework agnostic.
https://optimizely.github.io/nuclear-js/
MIT License
2.23k stars 141 forks source link

Caching Abstraction #211

Closed loganlinn closed 8 years ago

loganlinn commented 8 years ago

Introduce a functional caching abstraction. The purpose is to provide extensible API with abstractions that are composable. Includes implementations for basic cache strategy (current) and an LRU cache (which wraps BasicCache).

A custom caching strategy can be injected via Reactor constructor.

All existing caching behavior remains the same (for now).

Tangential to #208

scjackson commented 8 years ago

@loganlinn I dont like the interface but do like the approach

loganlinn commented 8 years ago

@scjackson Updated to support evicting a bunch of values from LRU when limit is reached

jordangarcia commented 8 years ago

Design looks good. I like how we can build the LRU cache using the BasicCache.

As far as implementation, see my comment regarding false positive cache hits.

scjackson commented 8 years ago

@loganlinn this LGTM. What do you want to do with this in terms of merging and my PR? Thoughts @jordangarcia?