We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 23637
    • 43 Posts
    I have such call of snippet:
    [[!getResourcesTag?
       &elementClass=`modSnippet`
       &element=`getResources`
     
       &parents=`100`
       &depth=`2`
       &limit=`20`
       &pageVarKey=`page`
     
       &includeTVs=`1`
       &includeContent=`1`
       &processTVs=`1`
       &tpl=`BloggFagligNyttRadMal`
    ]]
    
    <ul class="cPager">
      [[!+page.nav]]
    </ul>
    


    This is not cached. I want to cache this call. So I delete "!" and use like [[getResourcesTag? ... ]]

    Result of it is the pager disappeared, and if I click on the tag this list is the same for all selected tags. URL is like www.mysite.com/folder/?tag=Lonn&key=tags

    Tags come from
    [[!tagLister? &tv=`tags` &tpl=`TagFagligNyttListElement` &activeCls=`selected` &sortBy=`tag` &parents=`100` &limit=`20`]]
    


    So how to cache a page with tags and pager?
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      It can't be cached. It has to re-process on each page load, with its output depending on the passed value of "page". If it's cached, then it won't be able to do that, since it simply won't exist, because uncached snippet tags are removed on first page load.
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org