Skip to main content

r:cache

<r:cache />

Manually caches content for a given number of minutes that may be expensive to render.

This cache uses a strict time-based expiration. Editing the theme, site settings or page content will not bust the cache. This is particularly useful for large/resource intensive navigation menus that take a long time to build/render. Standard caching for menus is busted anytime changes are made to the theme, site, or any page setting or content.

For a large site that is actively maintained/edited during the day, this could prove costly for performance. Manually caching with this tag for a set time period could help alleviate this performance burden.

Note: It's best to use this tag only when necessary as it will cause confusion between the normal CleanSlate cache. In other words, use this reactively instead of proactively.

Attribute options

duration - The number of minutes to cache the content inside this tag for.

key - A unique string. Changing this value will invalidate the current cache cycle.

Example

<r:cache key="cache_version_001" duration="30">
  <r:site_menu max_depth="3" />
</r:cache>

{% cache %}

Manually caches content for a given number of minutes that may be expensive to render.

This cache uses a strict time-based expiration. Editing the theme, site settings or page content will not bust the cache. This is particularly useful for large/resource intensive navigation menus that take a long time to build/render. Standard caching for menus is busted anytime changes are made to the theme, site, or any page setting or content.

For a large site that is actively maintained/edited during the day, this could prove costly for performance. Manually caching with this tag for a set time period could help alleviate this performance burden.

Note: It's best to use this tag only when necessary as it will cause confusion between the normal CleanSlate cache. In other words, use this reactively instead of proactively.

Attribute options

duration - The number of minutes to cache the content inside this tag for.

key - A unique string. Changing this value will invalidate the current cache cycle.

Example

{% cache key: "cache_version_001", duration: 30 %}
  {% site_menu max_depth: 3 %}
{% endcache %}

Last updated on March 18, 2021.

We welcome all questions, feedback and bug reports. If you're having an issue, we usually need the following information:

  • A brief description of the issue
  • A link to the page where you saw the issue
  • Screenshots that illustrate the problem - How do I take a screenshot?

Kindly email CleanSlate@mail.wvu.edu for help or use the form on the request help page.