We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 20571
    • 3 Posts
    Because of how the PHP script works, I have programatic caching in two places. These are all the cache calls made in both files.

    File 1:
    $output = $modx->cacheManager->get($cache_name);
    $modx->cacheManager->set($cache_name, $output, 2147483647);

    File 2:
    $output = $modx->cacheManager->get($cache_name);
    $modx->cacheManager->set($cache_name, $output, 2147483647);

    So the same cache calls are used in both files. The set does set the cache files, and I can see them in the /core/cache directory. The get works fine, too.

    Periodically, I will do a ls to see the cache files, and will see all the ones that should be there. Then 3, 20, 51, or however many minutes later, all the files created by the above code are gone. The minutes between varies, and I have not yet found a pattern.

    When in Manager and choosing Site->Clear Cache, the programatic cache is not cleared.

    I went to http://rtfm.modx.com/display/revolution20/Caching to get the code for the caching. I first found that link from this forum post... http://modxcms.com/forums/index.php?topic=53295.0

    Why do you think the cache files are being deleted, and how do you suggest I prevent them from being deleted?

    MODx Revolution 2.0.8-pl (traditional)
    Red Hat Enterprise Linux Server release 5.5 (Tikanga) (CentOS)
    PHP Version 5.2.16
      • 20571
      • 3 Posts
      I moved the cache files into a custom directory outside of the modx core, and have not had the problems. I used the code in http://modxcms.com/forums/index.php?topic=62013.0 to change the directory.