adobe / adobe/aem-project-archetype

AMS Dispatcher does not flush cache on author

Open
#1,037 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
596
Forks
431
Avg merge
10d 6h
Merged PRs (30d)
1

Description

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](https://github.com/adobe/aem-project-archetype/blob/develop/src/main/archetype/dispatcher.ams/src/conf.dispatcher.d/available_farms/000_ams_author_farm.any) 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.

Contributor guide

Open the contributing guide

Research direction

Start with src/main/archetype/dispatcher.ams/src/conf.dispatcher.d/available_farms/000_ams_author_farm.any and inspect the vhost files under ./conf.dispatcher.d/vhosts/*.any. Reproduce or trace a Flush request and compare the dispatcher logs with the farm selected. Done means author cache invalidation selects the author farm instead of falling back to publishfarm.

Written by the indexing model from the issue text.

Assessment

Domain
infrastructure
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.