I have an aggregated display of Publishing Pages based on an expensive query which includes permissions, page location, page content type and publishing state, which means I'm caching the results of the query.
Now I'm looking for a way to invalidate this cache when necessary, which means I need to to know when a Page is published (including immediately after creation) or unpublished (including as a result of deletion), since this will invalidate the cached query result.
I've looked into the available mechanisms for determining when this happens, but what I've found so far doesn't quite seem to cut it:
SPFormContext.OnSaveHandler
- this seems specific to the Save button in the ribbon and wouldn't let me trap a Publish from, say, Manage Content and Structure. Right?
SPItemEventReceiver.ItemUpdated
- this doesn't seem to receive notifications for Publish and Unpublish. Right?
Is there a way to subscribe to the kind of "OnPublish" and "OnUnpublish" events I'm looking for? Or is there a different solution altogether?