Sha256: 76c7080d31037afbec5d0eb16299cd228b3c6f1f096749fadb7e2eca4c6bbcaf

Contents?: true

Size: 1.65 KB

Versions: 20

Compression:

Stored size: 1.65 KB

Contents

<!-- Tags for caching -->


<!-- `<hobo-cache>` is a simple fragment cache without the hierarchical dependency tracking used in `<swept-cache>` or `<nested-cache>`.

### Attributes

All extra attributes are used as cache keys.

`query-params`: A comma separated list of query (or post) parameters
used as non-hierarchical cache keys.

`route-on`: Rails fragment caching uses the the current route to build
its cache key.  If you are caching an item that will be used in
multiple different actions, you can specify route-on to ensure that
the different actions can share the cache.  You can pass either an
object or a path to route-on.  If you pass an object, it is converted
to a path with `url_for`.  If you specify route-on without a value,
`this` is used.  An alternative to using `route-on` is to specify
`controller`, `action` and any other required path parameters
explicitly.  For example route-on="&posts_path" is identical to
controller="posts" action="index".  If you do not specify route-on or
controller, action, etc., `params[:page_path]` or the current action
is used.

-->
<def tag="hobo-cache" attrs="query-params,route-on"><%
   unless Rails.configuration.action_controller.perform_caching
     %><%= parameters.default %><%
   else
     key_key_s = hobo_cache_key(:views, route_on, query_params, attributes)
     cache_content = Rails.cache.read key_key_s
     unless cache_content.nil?
       Rails.logger.debug "CACHE HIT #{key_key_s}"
       %><%= raw cache_content %><%
     else
       Rails.logger.debug "CACHE MISS #{key_key_s}"
       %><%= raw cache_content=parameters.default %><%
       Rails.cache.write(key_key_s, cache_content)
     end
   end
%></def>

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
hobo_rapid-2.2.6 taglibs/cache/cache.dryml
hobo_rapid-2.2.5 taglibs/cache/cache.dryml
hobo_rapid-2.2.4 taglibs/cache/cache.dryml
hobo_rapid-2.2.3 taglibs/cache/cache.dryml
hobo_rapid-2.2.2 taglibs/cache/cache.dryml
hobo_rapid-2.2.1 taglibs/cache/cache.dryml
hobo_rapid-2.2.0 taglibs/cache/cache.dryml
hobo_rapid-2.1.2 taglibs/cache/cache.dryml
hobo_rapid-2.1.1 taglibs/cache/cache.dryml
hobo_rapid-2.1.0 taglibs/cache/cache.dryml
hobo_rapid-2.1.0.pre4 taglibs/cache/cache.dryml
hobo_rapid-2.1.0.pre3 taglibs/cache/cache.dryml
hobo_rapid-2.1.0.pre2 taglibs/cache/cache.dryml
hobo_rapid-2.1.0.pre1 taglibs/cache/cache.dryml
hobo_rapid-2.0.1 taglibs/cache/cache.dryml
hobo_rapid-2.0.0 taglibs/cache/cache.dryml
hobo_rapid-2.0.0.pre10 taglibs/cache/cache.dryml
hobo_rapid-2.0.0.pre9 taglibs/cache/cache.dryml
hobo_rapid-2.0.0.pre8 taglibs/cache/cache.dryml
hobo_rapid-2.0.0.pre7 taglibs/cache/cache.dryml