aem-project-archetype icon indicating copy to clipboard operation
aem-project-archetype copied to clipboard

AMS Dispatcher does not flush cache on author

Open YegorKozlov opened this issue 1 year ago • 0 comments

It appears that the AMS Dispatcher configuration does not provide a way to flush cache on author dispatcher.

We develop authoring components whos client libraries are cached in author dispatcher, and we need to invalidate it after each deployment. Try as we might, we could not make it work in our AMS. Publisher cache gets invalidated just fine, but the Author cache won't.

On closer inspection it smells like an issue in the dispatcher.ams archetype configuration which we used to bootstrap the project.

The project defines a dedicated farm for AEM author, but this farm is never selected for Flush requests.

The "flush" vhost is not registered in any of ./conf.dispatcher.d/vhosts/*.any, so when a flush request comes in, Dispatcher falls back to the last available farm which is publishfarm, or whatever the last in the client setup is. We confirmed it from the logs . Every time we sending a Flush request, Dispatcher logs the following message:

[Sun Feb 05 08:21:36 2023] [W] [pid 40] No farm matches host 'flush', selected last farm 'publishfarm'

So no matter what parameters we pass to the Flush agent, it always resolves to a publisher farm and invalidates cache in the publish document root.

YegorKozlov avatar Feb 05 '23 10:02 YegorKozlov