We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 22629
    • 194 Posts
    I’ve been running a site on MODx 0.9.5 for a few months now, and I’m averaging ~12,000 page views a month.
    I’m trying to implement caching as the majority (90%) of pages are static content, but either I’m missing something, or it’s not working as it should.

    I’ve searched the forums and modxcms.com but cannot find anything relevant.

    The majority of documents are set as cacheable, and I’ve checked that the templates and static documents don’t have the [! !] syntax for plugins anywhere within.

    However I’m not getting any files generated in the "assets/cache" directory. When I go to empty cache in the manager, it constantly says "found 3 files in the cache directory, removed 0 cache files."

    Question is... does this sound right? What should I see be seeing created in the cache directory? Anything else I can check?

    Thanks,
    Andy.
      Andy Shellam | www.networkmail.eu | @Pandy06269 @NetworkMail

      modx Revolution 2.2.6
      Windows 2012 | IIS 8 | php 5.4.11 | MySQL 5.5.29

      Content-Managed Websites Built on MODX
      • 22629
      • 194 Posts
      I found that the DisableCache plugin was set to run (this was as standard from a clean 0.9.5 install).
      I’ve disabled this plugin and unregistered it from the OnLoadWebDocument event, but still getting the same.
        Andy Shellam | www.networkmail.eu | @Pandy06269 @NetworkMail

        modx Revolution 2.2.6
        Windows 2012 | IIS 8 | php 5.4.11 | MySQL 5.5.29

        Content-Managed Websites Built on MODX
        • 22629
        • 194 Posts
        Ah-ha! Finally sorted it.
        The "Template Switcher" plugin was also registered and running.
        Disabled this plugin - works fine with a "docid_<id>.pageCache.php" file in the cache directory.

        Why are these enabled as standard as they seem to affect the functionality quite severely?
          Andy Shellam | www.networkmail.eu | @Pandy06269 @NetworkMail

          modx Revolution 2.2.6
          Windows 2012 | IIS 8 | php 5.4.11 | MySQL 5.5.29

          Content-Managed Websites Built on MODX
          • 22303 MODX Staff
          • 10,725 Posts
          They’ve been completely removed in the 0.9.6 RC and will no longer be included in the distribution because of the various problems they have caused.

          Quote from: andyccn at Feb 28, 2007, 10:42 AM

          Ah-ha! Finally sorted it.
          The "Template Switcher" plugin was also registered and running.
          Disabled this plugin - works fine with a "docid_<id>.pageCache.php" file in the cache directory.

          Why are these enabled as standard as they seem to affect the functionality quite severely?
            • 28042 ☆ A M B ☆
            • 24,524 Posts
            This makes me feel bad that I ever started the TemplateSwitcher; it was only for a single site that wanted to be able to do that, and I thought it might be useful... undecided
              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
              • 18394
              • 1 Posts

              I find it useful, so thanks! wink

              However, I did have the same problem with caching appearing to be broken. I tweaked the code so that the cacheable flag overrides the plugin - it’ll only try to do it’s stuff on pages that I don’t want cached.

              if($modx->documentObject['cacheable'] == 0) {
                // template switching stuff here
              }
              


              This works for me and saves me remembering the "donotswitch" comment. Obviously your mileage may vary.
                • 25317
                • 122 Posts
                Quote from: andyccn at Feb 28, 2007, 10:42 AM

                Ah-ha! Finally sorted it.
                The "Template Switcher" plugin was also registered and running.
                Disabled this plugin - works fine with a "docid_<id>.pageCache.php" file in the cache directory.

                Just what I was looking for smiley

                The only fix I needed was this one. Disabling the plugin immediately allowed caching to work.