We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 15083
    • 697 Posts
    Hi there,

    Couple of things:
    1. Are you using memcahe or memcache(d) to connect to your cache server?
    xPDO's xPDOMemCache class will uses memcache, not memcache(d)
    2. Is the server definitly running on your localhost on localhost:11211

    When you clear the sites cache do you get any errors?
    If thee is an issue you will know about it in the console or the MODx error log.
      • 28780
      • 16 Posts
      Hi, the memcache server is located on a different server on a non-conventional port. I think it is memcache, since my test script has the following below and it works fine.

      $memcache = new Memcache;
      $memcache->connect($server_hostname, 12121) or die ("Could not connect");

      After changing the cache_handler and clearing the cache. I get no errors in the modx log, however when I pull up the memcache stats I don't see the server getting hit.

      my settings:
      cache_handler = xPDOMemCache
      cache_resource_key = resourceCache
      resourceCache_memcached_server = xx.xxx.xxx.xx:12121

      I've also noticed that the files are being generated into /core/cache/resource/ folder. Seems like it's stuck on file caching...
      • For MODX 2.1+, in which MODX already creates a "resource" partition for caching, simply use the following settings:

        — cache_resource_handler = "cache.xPDOMemCache"
        — resource_memcached_server = "memcache.tld:121212"

        This will configure the "resource" partition of the MODX cache to use the configured memcached server.
          • 28780
          • 16 Posts
          Hi opengeek! thanks for the quick reply. I've removed my 3 settings:
          cache_handler = xPDOMemCache
          cache_resource_key = resourceCache
          resourceCache_memcached_server = xx.xxx.xxx.xx:12121

          and included the two you provided, however its still not hitting the memcache server. It throws no errors either. It's as if its not listening to the settings when I change them. I've tried clearing the cache but still no go. I've left the settings there for hours and still nothing...
          • I have no problem doing so in a simple test here; I can see the stats changing immediately when telnet'ing into the memcached instance. Not sure what the issue could be... ?
              • 28780
              • 16 Posts
              I got it working!!! turns out the the /core/cache/system_settings/config.cache.php file wasn't being regenerated whenever I changed a setting via the modx manager....don't know why... so I had to remove the file and then it regenerated and presto!! it's working now!!
              THANKS for all your help opengeek! I appreciate your timely response.

              PS: after looking at your profile and seeing your role.....you are definitely one of the coolest people on the internet! Thank you sooo much for helping make MODX what it is today, it's an amazing product and you sir are worthy of praise, have a good night!
                • 28780
                • 16 Posts
                I got it working!!! turns out the the /core/cache/system_settings/config.cache.php file wasn't being regenerated whenever I changed a setting via the modx manager....don't know why... so I had to remove the file and then it regenerated and presto!! it's working now!!
                THANKS for all your help opengeek! I appreciate your timely response.

                PS: after looking at your profile and seeing your role.....you are definitely one of the coolest people on the internet! Thank you sooo much for helping make MODX what it is today, it's an amazing product and you sir are worthy of praise, have a good night!
                  • 15083
                  • 697 Posts
                  What system settings are required to switch the entire cache to memcached?
                    • 44424
                    • 1 Posts
                    I have tried every option and setting in this post and can't get MODx to talk to memcache.

                    my phpinfo() shows I am running
                    memcache 2.2.7

                    does anyone know the exact settings I need to make it work?

                    Thanks!
                    • Make sure you have read this — http://modx.com/blog/2012/09/24/using-memcached-for-modx-caching/ — it should explain the settings needed to make this work.