Dispatcher not adding cache-control to requests with query parameters

Avatar

Avatar
Validate 1
Level 1
cecheta
Level 1

Likes

2 likes

Total Posts

10 posts

Correct reply

0 solutions
Top badges earned
Validate 1
Ignite 1
Give Back
Boost 1
View profile

Avatar
Validate 1
Level 1
cecheta
Level 1

Likes

2 likes

Total Posts

10 posts

Correct reply

0 solutions
Top badges earned
Validate 1
Ignite 1
Give Back
Boost 1
View profile
cecheta
Level 1

26-05-2020

We are experiencing some unusual behaviour regarding Dispatcher. If we make a request to a page that should not be cached according to out dispatcher rules, and the request contains query parameters, then the response is missing the Cache-Control header.

We would expect to see 

cache-control: max-age=0, no-cache, no-store, must-revalidate

but we do not see the cache control header at all.

This is occurring regardless of whether the query parameter is in the list of ignored query params or not. If we remove the query params then we see the normal cache-control header as expected.

Accepted Solutions (0)

Answers (3)

Answers (3)

Avatar

Avatar
Validate 1
Level 1
cecheta
Level 1

Likes

2 likes

Total Posts

10 posts

Correct reply

0 solutions
Top badges earned
Validate 1
Ignite 1
Give Back
Boost 1
View profile

Avatar
Validate 1
Level 1
cecheta
Level 1

Likes

2 likes

Total Posts

10 posts

Correct reply

0 solutions
Top badges earned
Validate 1
Ignite 1
Give Back
Boost 1
View profile
cecheta
Level 1

27-05-2020

I did not realise the cache control: max-age=0 was not a Dispatcher out of the box feature, sorry.

 

In our Apache web server, we are adding the "cache-control: max-age=0, no-cache, no-store, must-revalidate" to all responses that do not contain the Etag header, as this means the page is not cached. This works as expected if the request does not contain a query string, but if the request does contain a query string then we do not see the cache-control header, even though Etag is missing. It is as if something is removing the cache-control header for requests with query strings. We have Cache-Control in our /headers config.

 

 

Avatar

Avatar
Contributor
Employee
hamidk92094312
Employee

Likes

103 likes

Total Posts

240 posts

Correct reply

38 solutions
Top badges earned
Contributor
Shape 1
Ignite 1
Give Back 50
Give Back 5
View profile

Avatar
Contributor
Employee
hamidk92094312
Employee

Likes

103 likes

Total Posts

240 posts

Correct reply

38 solutions
Top badges earned
Contributor
Shape 1
Ignite 1
Give Back 50
Give Back 5
View profile
hamidk92094312
Employee

26-05-2020

Check the /headers property in your dispatcher config file ti understand if "Cache-Control is set:

https://docs.adobe.com/content/help/en/experience-manager-dispatcher/using/configuring/dispatcher-co...

 

Hamid K

Avatar

Avatar
Validate 1
Level 4
raghavc
Level 4

Likes

63 likes

Total Posts

61 posts

Correct reply

19 solutions
Top badges earned
Validate 1
Give Back 5
Give Back 3
Give Back
Boost 50
View profile

Avatar
Validate 1
Level 4
raghavc
Level 4

Likes

63 likes

Total Posts

61 posts

Correct reply

19 solutions
Top badges earned
Validate 1
Give Back 5
Give Back 3
Give Back
Boost 50
View profile
raghavc
Level 4

26-05-2020

cache-control header is not set in AEM by default, So you will have to check at the custom rule/code which sets this header, maybe the regex to match the url expects a query parameter.

 

How are you setting the cache-control header ?