I am thinking of creating a custom resolver to publish a DCP at the same time a page is published. This DCP is not added to the page in the CMS, but is rendered on the page - hence the need for the custom resolver. The DCP should also be editable in XPM, so I was wondering if session preview publishing (aka fast track publishing) will trigger my custom resolver to ensure updates to the DCP are shown in session preview (or indeed if XPM will automatically republish the DCP as well as the page when I make edits).
On your first question I'm unsure, a resolver is called on publishing, but I'm unaware if a resolver is also called by the Session Preview/Fast Track Publishing indeed. That would be worth a test I'd say.
However your second question I can confirm, once you edit your DCP in XPM, its changes will already be published automatically once you check the Component in (finish editing). XPM will notice it is a DCP and publish its changes.
I think your resolved should only be needed for the initial publish of the Page, to also publish your DCPs. But having it in place will mean that every publish of that Page will also trigger your DCP to be published, even when it isn't updated of course.
On the subject of whether resolvers are triggered: the answer is No. From the online docs [login required]:
When Experience Manager users add or modify content, Experience Manager uses a different mechanism than regular publishing to update the content on the staging Web site.
This mechanism is called Session Preview. For performance optimization reasons, Session Preview should not be considered a substitute for actual publishing. It bypasses several publishing steps:
- It ignores any custom Resolvers you may have set up on the Content Manager side. (It does execute any custom Renderers, however.)
- It ignores any custom Modules and/or Processors you may have set up on the Content Deployer side. Because of the optimizations, you should not rely on normal Experience Manager use to replace regular publishing.
Rather, Experience Manager users should (if properly authorized) regularly explicitly publish content using the Publish button in the Ribbon toolbar Manage tab.