(Question #1)
Looking at modCacheManager class (line 445), i see the answer to question (1) is - ’
no, well kind of..’. It can clear a folder (and decedents) and specific file(s).
This is not an issue - as anyway I’ll use my own clearCache function. deleteTree function has delete_exclude_patterns, so regex can help : ’
/^((?!’.$cacheKey.’).)*$/’
The only thing that would be ’
nice to have’ is that the site-wide clear-cache (via manager) would read also a setting to clearCache - custom cache paths (without modding \core\model\modx\processors\system\clearcache.php :18)
I understand this could be resolved via a Plugin on OnCacheUpdate event, but I prefer not to (as /manager-clear_cache is really a misc function in my setup and -
"Any plugins registered to your events would be loaded into the context cache of every context in the system" - OpenGeek
http://modxcms.com/forums/index.php/topic,43595.msg260255.html#msg260255
more generic - would be nice if a (custom) class construct could register it’s cache-path for this purpose. Adding caching to any add-on, for example getResources’s rendered views (by tpl) would be a quite simple - as most modx setups use the manager interface - clearing the entire cache on each action (by default).
(Question #2)
’
yes’ - I see: xpdomemcache.class.php, well done - mr. generic

Also, I see the way it’s implemented in modCacheManager->clearCache : first [’objects’] delete from whatever cache handler, then [’path’] optionally removes from file-system.
Then - digging in xpdocachemanager.class.php, I just wanna say: jason, great stuff!
thanks.