Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.

Dispatcher expression that stores HIT or MISS value is not working on AMS dispatcher Setup.

Avatar

Level 1

One of our use cases is to provide the hit or miss value in the response header of any request. 

I am able to do that on my local setup that is on MAC M1 and every request i am receiving the hit or miss value in the response header of any request.

Below is the expression that gets the value, written in the publish.vhost file.

 

<IfModule headers_module>
    ....

    Header set Dispatcher-Cache %{dispatcher:cache}e

</IfModule>

 

However, I am not able to use the same logic in the Dispatcher AMS setup on my QA environment.

 

Please suggest why this not working. 

 

 

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

2 Replies

Avatar

Community Advisor

@eafcsdfs it should work, can you check for the below two things?

1. Check if the header is added to list of headers to be cached in publish farm

2. Did you try to flush the page from dispatcher and check for a fresh request?

Avatar

Level 1

Hi @Shashi_Mulugu ,

 

Thanks for the reply.

 

The problem here is I am not able to see the value of the expression "%{dispatcher:cache}e" as I am able to see the "Dispatcher-cache" added in the request header.

 

The header I have set in the publish.vhost file, so there is no need to have it in the client headers.

 

Also, my only question here is when I use this expression, above mentioned, every time I get a null value but in my local dispatcher setup I get the values as shown below.

 

 

Screenshot 2023-04-04 at 10.53.53 AM.jpg

 

This is from my local

Screenshot 2023-04-04 at 10.51.33 AM.jpg

 

This is from QA env