n8 / multi_fetch_fragments

Multi-fetch Fragments makes rendering and caching a collection of template partials easier and faster.
http://ninjasandrobots.com/rails-faster-partial-rendering-and-caching
MIT License
539 stars 63 forks source link

Add "cache_options" key, which is forwarded to MemCached. Used for "expires_in: 3.days" functionality #4

Closed nthj closed 11 years ago

nthj commented 11 years ago

I often have data that goes stale, even if the cache-key is the same. For example, I'll render "3 days ago", which needs to expire after a day. Or, I'll pull in the build-status into our dev bar from CircleCI. No cache-key, but I only want to poll every 5 minutes.

This pull request adds support for the key "cache_options" in the render call. Any options passed in are forwarded to the Rails.cache.write call, which will take care of forwarding on to MemCached. More options are described in the Rails Caching guide.