We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 49407
    • 159 Posts
    I recently upgraded to Revo 2.5.1 on Ubuntu 14.04 running apache with php7 and mysql 5.7.

    When I clear the cache, the new version of the start page (home page) shows up, great!

    The second person to visit the page, or sometimes third, gets the old version of the page. Funny thing is that when I look in the database at the snippets and chunks involved, they are not the old version. So... What in the world is going on?

    Oh and get this, I disabled caching in system settings, set everything to "No" except for the "disable_cache" value, which is set to yes, and also in the config file I set "$modx_cache_disabled= true;", yet after the second or third load Modx will create cache files and sure enough it has the OLD version of the "home" page in there, but all the other pages are their updated versions.

    I am using VersionX. I will remove that extra and then we shall see if the behavior persists. Something I thought of while writing this. If anyone else has experienced this kind of caching issue, please come forward. It's really bugging me right now and I feel like I'm the only one having caching issues.

    You don't suppose that this could be a php7 compatibility problem do you?
      • 49407
      • 159 Posts
      Quote from: aaronkent at Oct 18, 2016, 08:51 AM
      I am using VersionX. I will remove that extra and then we shall see if the behavior persists. Something I thought of while writing this. If anyone else has experienced this kind of caching issue, please come forward. It's really bugging me right now and I feel like I'm the only one having caching issues.

      Well, I disabled VersionX and it's still not honoring the caching settings in system settings. Still reverting to the old version of the start page resource (id 1), consistently, on the third page visit after clearing cache.

      I don't expect anyone will get to this until I've been asleep. I'll be back to check in several hours from now. If I can sleep at all with this problem on production.

      Another strange thing is that I have a sandbox installation of this exact same site on a subdomain, and before I pushed the sandbox updates out to the production site, which has a different database, I repeatedly tested everything with no trouble. Literally the only thing different about these two installations is that the database name and database username are different (to keep the data separate), but all the files got pushed to sync, database synced, and I ran through the setup process with all green marks and no warnings aside from the normal "change the config permissions to non-writable" which I did.

      I hope everyone is well-off as we approach Halloween! One of my favorite times of the year.
        • 38783
        • 571 Posts
        Hello,

        Are you clearing your cache from the Manager interface?
        If you are I would suggest trying to delete the cache files in the core/cache folder manually via FTP.

        It might be worth checking to see that both the references to the database are correct in your /core/config/config.inc.php are correct.

        $dbase = 'databaseNameHere';
        
        $database_dsn = 'mysql:host=yourConnectionType;dbname=databaseNameHere;charset=utf8';


        Whenever I encounter strange issues after updating a site from a development site I always refer back to this document. I usually find I have forgotten something listed in it!

        https://docs.modx.com/revolution/2.x/administering-your-site/moving-your-site-to-a-new-server

          If I help you out on these forums I would be very grateful if you would consider rating me on Trustpilot: https://uk.trustpilot.com/review/andytough.com

          email: [email protected] | website: https://andytough.com
          • 44922
          • 131 Posts
          I'd second what Andy says. We have had issues in the past where the Manager Clear Cache option has not cleared this fully. Even FTP wasn't totally 100% so we used to SSH using Putty into the core/cache folder and type rm -rf * to delete everything in the folder. That works.
            • 49407
            • 159 Posts
            I don't use the Manager interface to clear cache anymore. I am on a VPS so I use a shell script to push out my sandbox (dev) to production. That script sets all permissions and clears cache (rm -R /var/www/core_modx/cache/*) at the end. Then I visit the setup link and run through the setup process.

            I've just completed the push to production and setup process again a few minutes ago without errors or warnings. When I initially visit the site's start page it's correct. The second load, after the first cache write, it's the old version.

            Even with all my settings set as in the OP attachments, the Modx still caches everything. I can't make it stop. I just don't understand why it would show the correct version of the start page, then write cache, then have the old page back. Like I said, that older version only exists in VersionX, but disabling VX doesn't make the problem go away either.

            Could this be an Apache2 caching issue?
              • 49407
              • 159 Posts
              Quote from: andytough at Oct 18, 2016, 03:34 PM
              Hello,

              Are you clearing your cache from the Manager interface?
              If you are I would suggest trying to delete the cache files in the core/cache folder manually via FTP.

              It might be worth checking to see that both the references to the database are correct in your /core/config/config.inc.php are correct.

              $dbase = 'databaseNameHere';
              
              $database_dsn = 'mysql:host=yourConnectionType;dbname=databaseNameHere;charset=utf8';


              Whenever I encounter strange issues after updating a site from a development site I always refer back to this document. I usually find I have forgotten something listed in it!

              https://docs.modx.com/revolution/2.x/administering-your-site/moving-your-site-to-a-new-server


              I'm certain the database reference is correct as I've looked at it, but also in my push to production shell script it pulls backed up config files from a seperate folder and overwrites the sandbox config files. I've looked at every config file and they are all correct.

              I've just gone and verified that my shell script completes every step in the link you provided. It uses cp -R * to move the files from the sandbox to the production folder. In fact, I used that checklist to write the shell script.

              echo 'Starting push...'
              echo 'Removing all old version core files...'
              rm -R /var/www/production_core_modx/*
              echo 'Removing all old version site files...'
              rm -R /var/www/domain.com/*
              cp -R /var/www/sandbox_core_modx/* /var/www/production_core_modx
              echo 'Core files pushed to production...'
              cp -R /var/www/sandbox.domain.com/* /var/www/domain.com
              echo 'Site files pushed to production...'
              cp -R /var/www/pushing/config/core/* /var/www/production_core_modx
              echo 'Core config files pushed...'
              cp -R /var/www/pushing/config/site/* /var/www/domain.com
              echo 'Site config files pushed...'
              cp -R /var/www/pushing/config/site/setup/includes/* /var/www/domain.com/includes
              echo 'Site setup config pushed...'
              echo 'Setting config permissions to writeable...'
              chmod -R 0777 /var/www/production_core_modx/config
              chmod -R 0777 /var/www/production_core_modx/config.core.php
              chmod -R 0777 /var/www/production_core_modx/export
              chmod -R 0777 /var/www/production_core_modx/packages
              chmod -R 0777 /var/www/production_core_modx/cache
              rm -R /var/www/production_core_modx/cache/*
              echo 'Cache cleared...'
              echo 'Push complete!'


              Then I run the setup process and finish with the script below...

              echo 'Updating permissions...'
              chmod -R 0755 /var/www/domain.com
              chmod -R 0755 /var/www/production_core_modx
              chmod -R 0777 /var/www/production_core_modx/cache
              echo 'Permissions updated!'
              [ed. note: aaronkent last edited this post 7 years, 6 months ago.]
                • 49407
                • 159 Posts
                After reading about Apache2 caching and how to clear it, I decided to give it a go to cover all bases. Sure enough, it was the Apache2 cache that was the problem.

                However, I still can't get Modx to stop caching, even with all caching options turned off. Anyone else unable to disable cache in 2.5.1?