We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 14883 ☆ A M B ☆
    • 450 Posts
    Another obvious discovery: You really can't use 'getCache' on any chunk that contains your content, pagetitle, or any other field or TV that you want to show up in your page. I'll have to split up my 'html' chunk and figure out which pieces to use 'getCache' on and which not to.
      • 38290
      • 712 Posts
      Quote from: jrotering at May 01, 2013, 01:52 PM
      Another obvious discovery: You really can't use 'getCache' on any chunk that contains your content, pagetitle, or any other field or TV that you want to show up in your page. I'll have to split up my 'html' chunk and figure out which pieces to use 'getCache' on and which not to.

      Not sure I follow. Why not?
        jpdevries
        • 14883 ☆ A M B ☆
        • 450 Posts
        Quote from: dinocorn at May 01, 2013, 01:53 PM
        Quote from: jrotering at May 01, 2013, 01:52 PM
        Another obvious discovery: You really can't use 'getCache' on any chunk that contains your content, pagetitle, or any other field or TV that you want to show up in your page. I'll have to split up my 'html' chunk and figure out which pieces to use 'getCache' on and which not to.

        Not sure I follow. Why not?

        I should have clarified - you really can't use 'getCache' *with a custom cacheKey, to survive resource cache* on any chunk that contains your content, pagetitle...

        Because not being able to see content changes after updating a resource is rather sub-optimal.
          • 38290
          • 712 Posts
          Ah so yes, using a custom cache key makes sense to make things "survive" the resource cache. Things like global side headers and footers often make sense to use custom cache keys.
          With the new version of getCache you can create custom menu items to easily Clear your custom cache areas. With just a simple Plugin that listens on on site refresh, you can also make sure those areas get cleared on Site > Clear Cache.

          Back to the point, I think your observations are correct. getCache might not save you in those cases, but that doesn't mean there are other parts of your site that it couldn't. For example if you break your templates away from the 'master controller' snippet you may be able to use PropertySets directly on your tags to control properties. For example if you had myHeader and myFooter Chunks that were called directly from a Template, you may be able to wrap those in getCache, use a custom key, add a menu item to manually clear it only when you want your main nav and footer to get updated. That's kind of a lot of work though, you might be able to get a much greater pay off, with no extra configurations, simply by identifying parts of your template that are truly global (always the same on any page) and use getCache with cacheElementKey to tell MODX not to cache those tags per-resource but in one shared location.
            jpdevries