We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 32716
    • 9 Posts
    I am using MODx revolution 2.0.3 traditional, linux 2.2.15, php 5.2.13, mysql 5.0.91-community.

    I am following the instructions on http://rtfm.modx.com/display/revolution20/Caching to create a custom cache entry using php

    I do the following

    $my_test_string = 'this is a test';
    
    $modx->cacheManager->set('my_test', $my_test_string);
    


    This successfully creates the entry ../core/cache/my_test.cache.php

    However, when i use Site -> Clear Cache from within MODx admin the cache is cleared except my custom entry my_test.cache.php

    If i move my_test.cache.php into ../core/cache/web/resources then the file is removed when the cache is cleared.

    Any suggestions as to how i can get $modx->cacheManager->set to write my custom cache file into a location used by Clear Cache?

    Or could this be a bug with either Clear Cache or modCacheManager?

    Thanks in advance for any help.
      • 22303 MODX Staff
      • 10,725 Posts
      If you create cache entries outside of the standard locations where Revolution caches it’s data, with an unlimited lifetime, then those cache files will need to be removed via a Plugin registered with OnCacheUpdate that takes care of your custom cache entries.