We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 436 ☆ A M B ☆
    • 265 Posts
    For some reason one of my sites has become incredibly slow, both on the front-end and on the back-end. All pages take >1 second to load and in the back-end the tree and any AJAX takes a very long time to finish loading.

    In the error log I have spotted two errors which occur about 10-20 times each time any page is loaded, I think this is the culprit but I have no idea how to fix it:

    [2013-10-31 18:58:50] (ERROR @ /path/to/server/core/xpdo/cache/xpdocachemanager.class.php : 510) PHP warning: unlink(/path/to/server/core/cache/db/objects/modTemplateVar/cfd6650c37ea8f0a5a23a67af4455c4e.cache.php): No such file or directory
    [2013-10-31 18:58:50] (ERROR @ /path/to/server/core/xpdo/cache/xpdocachemanager.class.php : 518) PHP warning: closedir(): 366 is not a valid Directory resource


    The number in "366 is not a valid Directory resource" seem to change every time the error occurs.

    I've tried clearing the cache, deleting the /cache/ folder manually and this doesn't seem to have any effect. The system just rebuilds the cache files and the problem still persists.

    Has anybody seen this before or got any ideas?
      MODX Ambassador for Thailand. Managing Director at Monogon, a web design and development studio based in Bangkok, Thailand. - Follow me on Twitter.
      • 22303 MODX Staff
      • 10,725 Posts
      First, I would turn of cache_db. Unless you are running a load-balanced cluster of web nodes against a single database, or your database server is remote, there is not much benefit to using the cache_db feature in MODX.