OnBeforeSaveWebPageCache
Last updated Mar 17th, 2019 | Page history | Improve this page | Report an issue
Support the team building MODX with a monthly donation.
The budget raised through OpenCollective is transparent, including payouts, and any contributor can apply to be paid for their work on MODX.
Backers
Budget
$194 per month—let's make that $500!
Learn moreEvent: OnBeforeSaveWebPageCache¶
Fires after the Resource loads and before it is cached. The event only runs when the page was generated successfully. It also requires the cache_resource system setting (default 1) and cacheable = 1 on the Resource. Otherwise nothing is written to the cache and the event does not run.
- Service: 4 - Cache Service Events
- Group: System
Event Parameters¶
None. The Resource is available as $modx->resource.
Example¶
<?php
$eventName = $modx->event->name;
switch($eventName) {
case 'OnBeforeSaveWebPageCache':
$res = $modx->resource->get('id');
$modx->log(modX::LOG_LEVEL_ERROR, 'Resource with id '.$res.' booted successfully');
break;
}
See Also¶
Support the team building MODX with a monthly donation.
The budget raised through OpenCollective is transparent, including payouts, and any contributor can apply to be paid for their work on MODX.
Backers
Budget
$194 per month—let's make that $500!
Learn more










