docs/Optimization.md in flipper-0.11.0.beta3 vs docs/Optimization.md in flipper-0.11.0.beta4

- old
+ new

@@ -46,13 +46,19 @@ * **`:preload`** - An `Array` of feature names (`Symbol`) to preload for every request. Useful if you have features that are used on every endpoint. `preload` uses `Adapter#get_multi` to attempt to load the features in one network call instead of N+1 network calls. ```ruby config.middleware.use Flipper::Middleware::Memoizer, preload: [:stats, :search, :some_feature] ``` -* **`:preload_all`** - A Boolean value (default: false) of whether or not all features should be preloaded. Using this results in a `preload` call with the result of `Adapter#features`. Any subsequent feature checks will be memoized and perform no network calls. I wouldn't recommend using this unless you have few features (< 30?) and nearly all of them are used on every request. +* **`:preload_all`** - A Boolean value (default: false) of whether or not all features should be preloaded. Using this results in a `preload_all` call with the result of `Adapter#get_all`. Any subsequent feature checks will be memoized and perform no network calls. I wouldn't recommend using this unless you have few features (< 100?) and nearly all of them are used on every request. ```ruby config.middleware.use Flipper::Middleware::Memoizer, preload_all: true + ``` +* **`:unless`** - A block that prevents preloading and memoization if it evaluates to true. + ```ruby + # skip preloading and memoizing if path starts with /assets + config.middleware.use Flipper::Middleware::Memoizer, + unless: ->(request) { request.path.start_with?("/assets") } ``` ## Cache Adapters Cache adapters allow you to cache adapter calls for longer than a single request and should be used alongside the memoization middleware to add another caching layer.