Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AMS Dispatcher] A new flush vhost to invalidate author cache #1038

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

YegorKozlov
Copy link

Description

The PR adds a new vhost to invalidate cache on author dispatcher in AMS setups.

Related Issue

#1037

Motivation and Context

The current AMS Dispatcher configuration does not provide a way to flush cache on author dispatcher. Flush requests always resolve to a publisher farm which invalidates content in publisher document root.

The PR adds a new "authorflush" vhost which resolves to the author farm. To use it from AEM you'd need to define a new Flush agent and set authorflush in the Host header:

image

How Has This Been Tested?

In our setup we use the Dispatcher Flush UI tool, but the problem is also reproducible from curl. Execute the commands below while tailing dispatcher.log :

Current behaviour using the default "flush" vhost.

curl http://localhost/dispatcher/invalidate.cache \
-H "CQ-Action: Delete" \
-H "CQ-Handle: /apps" \
-H "Host: flush"

dispatcher resolves publishfarm and invalidates publish docroot (/mnt/var/www/html)

[Sun Feb 05 13:17:45 2023] [W] [pid 18] No farm matches host 'flush', selected last farm 'publishfarm'
[Sun Feb 05 13:17:45 2023] [D] [pid 18] Found farm publishfarm for flush
[Sun Feb 05 13:17:45 2023] [D] [pid 18] checking [/dispatcher/invalidate.cache]
[Sun Feb 05 13:17:45 2023] [I] [pid 18] Activation detected: action=Delete [/apps]
[Sun Feb 05 13:17:45 2023] [I] [pid 18] Touched /mnt/var/www/html/.stat
[Sun Feb 05 13:17:45 2023] [D] [pid 18] response.status = 200

The fixed behaviour using the new "authorflush" vhost.

curl http://localhost/dispatcher/invalidate.cache \
-H "CQ-Action: Delete" \
-H "CQ-Handle: /apps" \
-H "Host: authorflush"

dispatcher resolves authorfarm and invalidates publish docroot (/mnt/var/www/author)

[Sun Feb 05 13:32:26 2023] [D] [pid 26] Found farm authorfarm for authorflush
[Sun Feb 05 13:32:26 2023] [D] [pid 26] checking [/dispatcher/invalidate.cache]
[Sun Feb 05 13:32:26 2023] [I] [pid 26] Activation detected: action=Delete [/apps]
[Sun Feb 05 13:32:26 2023] [I] [pid 26] Touched /mnt/var/www/author/.stat
[Sun Feb 05 13:32:26 2023] [D] [pid 26] response.status = 200

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • I have signed the Adobe Open Source CLA.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant