Search code examples
cachingezpublish

fetch inside cache block run every time in ezpubllish?


I have a cache block in my template file like

{cache-block keys=$gallery.node_id subtree_expiry=$gallery.node_id expiry=0}
        <div>
            {def $sales_price =fetch('content', 'node', hash( 'node_id', 5564))}
            {attribute_view_gui attribute=$sales_price.data_map.body}
        </div>
{/cache-block}

Do the fetch query run every time? Or once the content is cached it will not run before the cache expires?


Solution

  • The content of a cache block is processed only when it's expired and needs to be regenerated.

    So the answers are :

    • Do the fetch query run every time? => no, only when the block expires
    • Or once the content is cached it will not run before the cache expires? => yes