Hi, this is only my second post on this forum, so apologies if it’s in the wrong forum, feel free to move it etc...
I’m working on a reasonably busy site that I recently converted to MODX. As they get a lot of traffic, and the server isn’t as amazing as it used to seem, I’ve opted to enable full caching - pages, snippits etc.
The caching is working well, but the client updates their site regularly (they are a magazine), and obviously they are clearing the cache every time they update the site.
Because they are clearing the cache and the site is so busy, it’s causing me a bit of a headache with high server loads, so I’ve been hacking the MODX core a bit to change the way the cache is cleared.
So basically, my question is - what are the implications of the following change to the cache_sync.class.processor.php file?
//added this function
function removeCachePage($doc_id) {
$cacheFile= $this->cachePath . "docid_" . $doc_id . ".pageCache.php";
@unlink($cacheFile);
}
Then, in the relevent processor files changing the call
to
$sync->removeCachePage($_REQUEST['id']);
I’ve already implemented it, and it seems to work well, it stops a page save / delete from emptying the entire cache, as now we just remove the offending page rather than all the pages. But... will I regret this later down the line?
Thanks in advance for your help.
EDIT: Using Version 0.9.6.2