AEMaaCS + local dispatcher: how to test caching? | Community
Skip to main content
jayv25585659
Level 8
October 2, 2025
Question

AEMaaCS + local dispatcher: how to test caching?

  • October 2, 2025
  • 3 replies
  • 604 views

TLDR: I'm trying to investigate query param caching (example: /archive.html?page=xxx&year=yyyy) in my local dispatcher and I'm not sure how to test for it.

-----------
1. 

 

If I visit https://www.myhost.com/content/myapp/sg/en/faq.html, I'm pretty sure an HTML file is created in the dispatcher filesystem (maybe in /var/www/html).

If I visit http://localhost:8080/content/myapp/sg/en/faq.html, where can I find the HTML file for this page?

I tried this command (after running docker exec) but it only found the default Apache HTTPD index.html. Any ideas? Thanks

54177f4f6b8b:/# find / -iname "*.html" -type f 2>/dev/null /var/www/localhost/htdocs/index.html

--------

2. I am trying to test Cache-Control but no matter what value I set, it seems the value is always the same. ("public,max-age=60,s-maxage=300,stale-while-revalidate=86400,stale-if-error=86400")
As a test I tried this

Header set Cache-Control max-age=0

Is this normal behavior?
------

EDIT1: I tried both docker_run_hot_reload.sh and docker_run.sh to start the dispatcher. It does not make a difference.

EDIT2: I saw the cache folder inside /dispatcher-sdk-2.0.235 and it contains no files. I made sure the cache folder is writable by everyone by running chmod -R 777 cache.

 

3 replies

arunpatidar
Community Advisor
Community Advisor
October 2, 2025

Hi @jayv25585659 

You would find a cache folder at root directory of dispatcher-sdk from where you are running those docker scripts.

Arun Patidar
jayv25585659
Level 8
October 2, 2025

I saw that and the folder contains no files

# pwd /home/myuser/Documents/aem-sdk-2025.1.19149.20250116T154450Z-241100/dispatcher-sdk-2.0.235 # find cache -type f | wc -l 0
arunpatidar
Community Advisor
Community Advisor
October 2, 2025

Hi @jayv25585659 

Then please check the dispatcher config to allow cache.

 

Can you also try using docker terminal to check the cache

 

Arun Patidar
shiftsaas
Level 2
March 16, 2026

Hi, ​@jayv25585659 

When running the Dispatcher SDK locally, cached files are not stored under /var/www/localhost/htdocs.
Inside the container they are typically written to:

/mnt/var/www/html

You can verify caching by checking the dispatcher log:

docker exec -it <container_id> tail -f /var/log/apache2/dispatcher.log

It will show hit / miss / refresh.

Also note that requests with query parameters are not cached by default unless /ignoreUrlParams is configured in the farm.

I wrote a short guide on validating Dispatcher locally (same way Cloud Manager does):
https://www.shiftsaas.com/adobe-experience-manager/validate-aem-dispatcher-locally-like-cloud-manager/

AEM Developer | Technical Articles: https://medium.com/@shiftsaas
AmitVishwakarma
Community Advisor
Community Advisor
March 18, 2026

Hi ​@jayv25585659 

1) Where is the cached HTML for http://localhost:8080/...?
With the AEMaaCS Dispatcher SDK:

  • Inside the container the dispatcher docroot is: **/mnt/var/www/html**
  • On your host machine, that path is mounted to the SDK's cache folder, e.g.: dispatcher-sdk-2.0.235/cache/...

So:

If you docker exec into the container, look under: ls -R /mnt/var/www/html

 

Not under /var/www/localhost/htdocs – that's Apache's default, not the Dispatcher docroot used by the SDK.

If cache/ stays empty, either:

  • You're not really going through dispatcher (hitting publish directly), or
  • The path is not allowed by /cache /rules or is filtered out; double‑check your farm's /filter and /cache sections.

2) Why Cache-Control always stays public,max-age=60,...?

That header comes from the default AEMaaCS dispatcher vhost config, which sets HTML caching centrally (to mimic Cloud behavior):

# (simplified)
<LocationMatch "^/content/.*\.html$">
Header set Cache-Control "public,max-age=60,s-maxage=300,stale-while-revalidate=86400,stale-if-error=86400"
</LocationMatch>

When you add:  Header set Cache-Control max-age=0

in some earlier file or scope, it is overridden later by the default rule above. mod_headers is "last matching rule wins".

How to really change it

You have two solid options:

A. Turn off the default HTML caching and fully control it yourself

In dispatcher/src/conf.d/variables/global.vars: Define DISABLE_DEFAULT_CACHING 

Then in your vhost (after includes):

<LocationMatch "^/content/.*\.html$">
Header unset Cache-Control
Header set Cache-Control "max-age=0"
</LocationMatch>

B. Override more specifically, after the default header

Keep default caching for most pages, override a subset:

# after the default include
<LocationMatch "^/content/myapp/sg/en/faq\.html$">
Header unset Cache-Control
Header always set Cache-Control "max-age=0"
</LocationMatch>

Place this in the same vhost and after the archetype's cache-control snippet so your rule wins.

3) Testing query‑param caching locally

Dispatcher's behavior with query params is controlled by /ignoreUrlParams in the farm:

  • Params listed there are ignored when building the cache key.
  • Others produce distinct cache entries (one per full URL), as long as /cache /rules allow the path.

To test:

  • Hit twice:  curl -I "http://localhost:8080/archive.html?page=1&year=2024"
  • Watch publish access.log:
    • First request -> goes to publish.
    • Second request -> should not hit publish if Dispatcher cached it.

You'll also see a file under cache/... with an encoded name for that URL.

Amit Vishwakarma - Adobe Commerce Champion 2025 | 16x Adobe certified | 4x Adobe SME