Dispatcher expression that stores HIT or MISS value is not working on AMS dispatcher Setup. | Community
Skip to main content
Level 2
April 3, 2023

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

  • April 3, 2023
  • 1 reply
  • 964 views

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. 

 

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

1 reply

Shashi_Mulugu
Community Advisor
Community Advisor
April 3, 2023

@kr_saurabh1707 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?

Level 2
April 4, 2023

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.

 

 

 

This is from my local

 

This is from QA env