Answer the question
In order to leave comments, you need to log in
How to clear the cache when creating a page from the frontend?
On MODx Revo, I use the ms2form add-on to create pages through the frontend. The trouble is that the cache is not updated during creation, and all links leading to a new document (breadcrumbs, for example) do not work until you clear the cache manually in the admin panel. This is not good, since the site assumes a large number of user-created pages.
I created a plugin and hung it on the OnDocFormSave event with the following code:
$res = $modx->getObject('modResource', 106);
$res->clearCache();
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question