Reputation: 3187
How would I go about expiring a fragment cache after a period of time. I came across references to a timed_fragment_cache
gem, but it seems out-dated.
Upvotes: 33
Views: 13307
Reputation: 9481
Using ActiveSupport::Cache::Store
, you should be able to do
<% cache(key, expires_in: 1.hour) do %>
<!-- content -->
<% end %>
Upvotes: 89