We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 23072
    • 150 Posts
    Not sure if this is the correct place to post this, but I’m having troubles with a site not caching in Evo 1.0.

    I’m finding it most odd as the pages are set to cache, the config option is set for new pages to be cacheable by default I’ve emptied the cache even to see if I’m losing my marbles, but no matter what I do pages will simply not cache.

    I even created a test page that was just a few lines of text and used the default Minimal Template to make sure it wasn’t one of my temlates causing an issue, but that doesn’t cache either. No matter how many times I reload the test page it gives me the following:

    MySQL: 0.0071 s, 4 request(s), PHP: 0.3008 s, total: 0.3078 s, document retrieved from database.

    Obviously the numbers vary a little, but the "document retrieved from database" line stays the same.

    Any ideas? Am I just missing an option somewhere that might have allowed me to inadvertantly turn of caching site-wide? Could there be some .htaccess directive that’s screwed it up?

    Tearing my hair out here wink
      Notanotherdotcom Ltd

      Web | Print | Marketing
      • 23072
      • 150 Posts
      I forgot to mention that when I visit pages on the site I’m builfing and then empty the cache in the manager, it says:

      Cache: Found 4 files in cache directory and deleted 0 cache files.

      So I’m reasonably sure it’s not caching, just completely clueless as to why.

      Any help would be much appreciated smiley
        Notanotherdotcom Ltd

        Web | Print | Marketing
      • I’d lean towards permissions problems on the cache directory. I’d also update to RC3, since there’s a lot updated since RC1.
          Ryan Thrash, MODX Co-Founder
          Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
          • 23072
          • 150 Posts
          Most odd - I tried both of these suggestions and still no dice.

          I’ll just try a fresh install and see if I can get the cache working on that first to check it’s not some weird issue with this domain on my VPS (can’t see why it would be, but eliminating possibiliites).

          Cheers for the suggestions so far - didn’t even realise RC3 was out! Very swish smiley
            Notanotherdotcom Ltd

            Web | Print | Marketing
          • If you are viewing the pages while logged in as a Manager user, they won’t cache. The four files it finds are other stuff, not individual cached pages.
              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
              • 23072
              • 150 Posts
              It turned out is was because of TemplateSwitcher (yes, quite an old installation that’s been upgraded several times!).

              I found the issue on the WIKI and the solution was simply to disable the plugin.

              I know it’s going to be a rarer occurrence over time, but is there any way the installer could have an additional check added when upgrading and display a warning about this plugin if it finds it?

              The only reason I was aware of the issue at all was because I still had the extra info being outputted at the bottom of my template - if it weren’t for that I’d never have known there was an issue present that was affecting site performance (well, not by much as I didn’t notice things going slowly per se, but it practically halved the number of queries on a lot of pages bringing them down to 10 or less as I have a lot of snippets running in places).

              Many thanks to all for your suggestions! False alarm on it being an Evo 1.0 issue - turns out that was just the version I was using when I finally noticed!
                Notanotherdotcom Ltd

                Web | Print | Marketing
              • That’s a great idea Pete. Please open an issue in JIRA with this suggestion. I think it’s best to note that the Template Switcher plugin has been found and will be disabled due to the problems.

                http://svn.modxcms.com/jira/browse/MODX-1035
                  Ryan Thrash, MODX Co-Founder
                  Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
                  • 23072
                  • 150 Posts
                  Cheers for that Ryan - much appreciated.

                  I imagine that a lot of the folks upgrading from versions pre 0.9.6 may notice a speed increase when upgrading if they’ve not already disabled it, even if it’s a small one overall it’ll at least mean less requests to the database.

                  I’m just thinking of all eventualities now - it might also be worth mentioning that they should check their page caching is working properly, as if they’ve set some things to cache that maybe they shouldn’t have (such as custom-coded snippets that may actually need caching to be switched off to work properly for example - I’ve coded a few of those myself) and the plugin is disabled, they’ll not know that there may be a difference in their page output after upgrading. That would be a very small minority I imagine, but you can never say "check your site after upgrading" enough times wink

                  I made a note of the above scenario in the issue on Jira too - I must remember to post these things there!

                  Thanks again
                    Notanotherdotcom Ltd

                    Web | Print | Marketing
                  • I must say that I created that plugin for a specific purpose for a specific site, and was a little surprised that it was put into the default distribution. I suppose quite a few people found it useful, but it was really never intended to be for the average site that doesn’t want to have optional template switching. And for sites that do want it, it’s a trade-off between the functionality and the caching.
                      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
                      • 23072
                      • 150 Posts
                      Indeed - it’s a useful snipet if you need it in a project, no doubt about that.
                        Notanotherdotcom Ltd

                        Web | Print | Marketing