Forum: Ruby on Rails Globally keyed cache fragments across all controllers

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
979c3d4bf493789000abe2eba635a4a4?d=identicon&s=25 Jake Blake (jblake)
on 2012-08-02 07:11
In the documentation for fragment caching
(http://guides.rubyonrails.org/caching_with_rails.h...),
this is stated:

  If you don’t want the cache block to bind to the action that called
it, You can also use globally keyed fragments by calling the cache
method with a key, like so:

  <% cache('all_available_products') do %>
    All available products:
  <% end %>

  This fragment is then available to all actions in the
ProductsController [...]

Is it possible to add a globally keyed cache fragment that is available
in _all_ controllers, not just ProductsController as in the example
above? I plan on having a list of the top 10 items of one of my models,
in my layout, so it'd be ideal to have that cached globally.
This topic is locked and can not be replied to.