We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 9191
    • 20 Posts
    See topic. Every time I update my included snippet code I have to manually clear the cache and that’s annoying.

    Obviously I could make it an uncached call but I’ll want the thing to be cached in the future and I don’t want to have to remember to change it later.
      • 22303 MODX Staff
      • 10,725 Posts
      Quote from: evan at May 10, 2007, 10:09 AM

      See topic. Every time I update my included snippet code I have to manually clear the cache and that’s annoying.

      Obviously I could make it an uncached call but I’ll want the thing to be cached in the future and I don’t want to have to remember to change it later.

      @evan: Though I do this for all snippets because I prefer my php code on the file system, and not cached in the siteCache file, you can simply change your snippet to a one line return include() that includes your snippet code from a regular php file. This is great for development, and for production, has the added benefit of reducing the siteCache file size and/or allowing code changes to be tracked in SVN.

      In 0.9.7, there will be a new constant (MODX_CACHE_DISABLED) that can be used to disable all caching for such purposes, in addition to several new caching options in general.
        • 19726
        • 239 Posts
        I am using a plugin with the following code in it:
        $modx->documentObject['cacheable'] = 0;
        I am pretty sure it came from the forums somewhere, but I can’t find the original right now. Make sure to let it trigger on the "OnLoadWebDocument" event. Just disable the plugin when you are done with developing.
          • 9191
          • 20 Posts
          Quote from: Mitch at May 10, 2007, 02:24 PM

          I am using a plugin with the following code in it:
          $modx->documentObject['cacheable'] = 0;
          I am pretty sure it came from the forums somewhere, but I can’t find the original right now. Make sure to let it trigger on the "OnLoadWebDocument" event. Just disable the plugin when you are done with developing.

          Thanks, I don’t know why I didn’t think of this. I love elegantly simple solutions like this.

          I feel like I’m still only scratching the surface of the plugin system’s potential.
            • 6726
            • 7,075 Posts
            Yeah it’s the Disable Cache plugin, bundled with MODx wink

            Pretty handy smiley
            I think Susan wrote it, needed to have the TemplateSwitcher working...
              .: COO - Commerce Guys - Community Driven Innovation :.


              MODx est l'outil id
              • 28042 ☆ A M B ☆
              • 24,524 Posts
              Not that I recall, I just made sure my documents weren’t cached. But I don’t know who did it, either.
                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
                • 6726
                • 7,075 Posts
                My mistake, thought it was you tongue
                  .: COO - Commerce Guys - Community Driven Innovation :.


                  MODx est l'outil id
                  • 33337
                  • 3,975 Posts
                  It was written by Raymond (xWisdom). wink

                  http://modxcms.com/forums/index.php/topic,870.msg5526.html#msg5526

                  regards.
                    Zaigham R - MODX Professional | Skype | Email | Twitter

                    Digging the interwebs for #MODX gems and bringing it to you. modx.link
                    • 6726
                    • 7,075 Posts
                    Thanks Zi for setting the records right smiley
                      .: COO - Commerce Guys - Community Driven Innovation :.


                      MODx est l'outil id