fetch_or_cache_partial
![Moderate documentation Importance_2](https://d2vfyqvduarcvs.cloudfront.net/images/importance_2.png?1349367920)
- 1.0.0
- 1.1.6
- 1.2.6
- 2.0.3
- 2.1.0
- 2.2.1
- 2.3.8
- 3.0.0
- 3.0.9
- 3.1.0
- 3.2.1
- 3.2.8
- 3.2.13
- 4.0.2
- 4.1.8
- 4.2.1
- 4.2.7
- 4.2.9
- 5.0.0.1 (0)
- 5.1.7 (0)
- 5.2.3 (0)
- 6.0.0 (38)
- 6.1.3.1 (0)
- 6.1.7.7 (0)
- 7.0.0 (0)
- 7.1.3.2 (0)
- 7.1.3.4 (0)
- What's this?
fetch_or_cache_partial(cached_partials, template, order_by:)
private
`order_by` is an enumerable object containing keys of the cache, all keys are passed in whether found already or not.
`cached_partials` is a hash. If the value exists it represents the rendered partial from the cache otherwise `Hash#fetch` will take the value of its block.
This method expects a block that will return the rendered partial. An example is to render all results for each element that was not found in the cache and store it as an array. Order it so that the first empty cache element in `cached_partials` corresponds to the first element in `rendered_partials`.
If the partial is not already cached it will also be written back to the underlying cache store.