BobRay/CacheMaster

Feature request: Clear parents on doc save and per context

Closed this issue · 3 comments

Hi BobRay,

1: I think it would be nice to have an option to clear the cache of all parents on saving a child document up to the highest parent under the root/context.

For example: When I change/add a child resource to an overview/catelog then I now also have to save the overview/catelog resource to clear it's cache so that the changes will be visible on the frontend.

2: And would be clearing only the cache of the current context also be a nice feature?
My previous forum topic http://forums.modx.com/thread/96097/empty-cache-per-context-on-resource-save?page=2#dis-post-529055 (sorry BobRay, I haven't had time to test your snippet).

Kind regards,

Marten

Sorry about missing this. I'm not sure I see how clearing the ancestors's caches would be useful.

Clearing a context could be a useful feature, but I'm not sure if it's feasible. I'll look at doing that.

[update]
I looked at doing this, and it's doable, but on second thought, I can't think of a case where you'd want to clear the entire resource cache for a context for the resource's context whenever you save a resource. You always have the option of clearing the site cache by checking the "Empty Cache" checkbox.

Feel free to give me more information on why you'd want to do either of these.

I'm using MODX for a multi website CMS. We host 100 websites on one MODX installation. Because of that reason we would like to empty the cache for an individual context.

Ah, I get it now. It would only work for resources, because the rest of the cache is not organized by context.

Does MODX clear the resource cache for all contexts (sites) when you save any resource? If so, maybe this would be a good feature request for MODX itself. It's kind of the opposite of what CacheMaster does, which is to not clear the cache except for the current resource.