Keyhole caching tag that improves site performance
[%cache id:'uniqueid' type:'content'%] <p>[@sku@]</p> [%/cache%]
Creating a cache tag around a block of content saves everything contained in that block to neto, meaning that dynamic tags or logic held within are only needed to be rendered once, before that result is then shown to every other use who calls that same block.
This block will then only be refreshed to reflect updates if either the cache is cleared from within the control panel or if the type is configured correctly, whenever the data tags within are updated in Neto.
type:''parameter is required and must have a valid value (cannot be blank).
Caching thumbnails is one of the most cost effective caches you can apply within neto.
By using the
[@inventory_id@] data tag for the cache tag we ensure that along side the appropriate type tag, each thumbnail has its own unique ID
In the sample below we cache a
[%if%][%/if%] and store it to a thumbnail
[%cache type:'gallery' id:'[@inventory_id@]'%] [%if [@price@] > 100%]<p>Free shipping</p>[%/if%] [%/cache%]
When using the
menu tag to generate a menu that's statically defined via our CMS, you'll want to use the
type:'menu' which will ensure that if you update the CMS menu, the system will automatically find & clear the cache for this tag.
When using either the
content_menu or the now deprecated
category_menu tags - you'll want to use the
type:'cmenu' which will ensure that when any content in any content type is updated - the cache will be cleared to reflect the new category, blog, etc.
Note that if you are caching a menu that changes depending on the category you are on, for example, automatically being open when selected, you'll need a new ID for each state depending on the ID. The example below we use the
[@config:current_category@] data tag to ensure a unique ID for each state of the menu.
[%cache type:'cmenu' id:'mainmenu-[@config:current_category@]'%] <p>[@name@]</p> [%/cache%]
|id:''||String||The ID of the cache, two cache tags with the same ID & type will conflict and only load the first result rendered. The same ID on two types of cache tags will act as individual cache tags|
||By using types, this will enable specific behaivour within neto to refresh a cache tag if the data tags within are changed in neto.