Exclude a page from Dispatcher caching | Community
Skip to main content
akhilraj
Level 5
April 20, 2022
Solved

Exclude a page from Dispatcher caching

  • April 20, 2022
  • 1 reply
  • 1341 views

Hi,

 

How to exclude a particular page from getting cached in dispatcher

Kindly provide the syntax for the same

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

Hi Akhil,

Welcome to AEM Community !!

 

I am not sure about the IIS version of the Dispatcher you have configured, but certainly with the Apache module if you add a custom HTTP header "dispatcher: nocache" it will not cache the page in the Dispatcher.

You might need to change the code to add this, which would be something like: request.setHeader("Dispatcher", "nocache");

It might also work as meta tags in the html, but I've not tried this.

Thanks,

Vikram Gaur

1 reply

vikram1285Adobe EmployeeAccepted solution
Adobe Employee
April 20, 2022

Hi Akhil,

Welcome to AEM Community !!

 

I am not sure about the IIS version of the Dispatcher you have configured, but certainly with the Apache module if you add a custom HTTP header "dispatcher: nocache" it will not cache the page in the Dispatcher.

You might need to change the code to add this, which would be something like: request.setHeader("Dispatcher", "nocache");

It might also work as meta tags in the html, but I've not tried this.

Thanks,

Vikram Gaur

akhilraj
akhilrajAuthor
Level 5
April 21, 2022

Yes, 

response.setHeader("Dispatcher", "no-cache");