Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

Query parameter is getting cached only in publisher/dispatcher

Avatar

Avatar
Give Back
Level 2
vijays80591732
Level 2

Likes

6 likes

Total Posts

56 posts

Correct Reply

4 solutions
Top badges earned
Give Back
Ignite 1
Validate 1
Boost 5
Boost 3
View profile

Avatar
Give Back
Level 2
vijays80591732
Level 2

Likes

6 likes

Total Posts

56 posts

Correct Reply

4 solutions
Top badges earned
Give Back
Ignite 1
Validate 1
Boost 5
Boost 3
View profile
vijays80591732
Level 2

13-07-2020

Hi All,

 

I have the below URL with the query parameter.I'm triggering a servlet and the servlet will pick the query parameter value and it will give the response based on query param value.

 

EX: https://wwwqa.powerlb.product.com/content/product/au/en_au/iron-product.html?q=Iron_tablets

 

It is working fine in AEM author instance and issue with only in the dispatcher. If, I hit the same URL with different params, I'm getting the caching/incorrect response in the dispatcher. 

 

EX: https://wwwqa.powerlb.product.com/content/product/au/en_au/iron-product.html?q=Calcium_tablets

 

if I hit the above URL in the dispatcher, I'm the response for the first param (q=Iron_tablets). Can you help here to fix the issue.

 

@arunpatidar26 @smacdonald2008 @arunpatidar26 @Ratna_Kumar @kautuk_sahni @wimsymons @cqsapientu69896 @vanegi @Veena_Vikram @varuns7990 @Theo_Pendle

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Establish
MVP
Nupur_Jain
MVP

Likes

165 likes

Total Posts

186 posts

Correct Reply

76 solutions
Top badges earned
Establish
Ignite 1
Give Back 5
Give Back 3
Give Back 25
View profile

Avatar
Establish
MVP
Nupur_Jain
MVP

Likes

165 likes

Total Posts

186 posts

Correct Reply

76 solutions
Top badges earned
Establish
Ignite 1
Give Back 5
Give Back 3
Give Back 25
View profile
Nupur_Jain
MVP

14-07-2020

Hi @vijays80591732 

 

Seems like query parameter caching is enabled in dispatcher. Check /ignoreUrlParams section of dispacher.any file if it has any rules defined like:

 

/ignoreUrlParams
{
    /0001 { /glob "*" /type "deny" }
    /0002 { /glob "q" /type "allow" }
}

 

This rule makes the query param request cachable and basically ignores query param "q" for further request and returns the same cached response.

 

Refer https://docs.adobe.com/content/help/en/experience-manager-dispatcher/using/configuring/dispatcher-co... and read more on ignoreUrlParams section. 

 

Hope it helps!

Thanks!

Nupur

Answers (2)

Answers (2)

Avatar

Avatar
Affirm 50
MVP
Vaibhavi
MVP

Likes

216 likes

Total Posts

181 posts

Correct Reply

61 solutions
Top badges earned
Affirm 50
Validate 1
Ignite 1
Give Back 5
Give Back 3
View profile

Avatar
Affirm 50
MVP
Vaibhavi
MVP

Likes

216 likes

Total Posts

181 posts

Correct Reply

61 solutions
Top badges earned
Affirm 50
Validate 1
Ignite 1
Give Back 5
Give Back 3
View profile
Vaibhavi
MVP

14-07-2020

Hi @vijays80591732 ,

 

By default, dynamic requests are not cached which is a request with query parameter.  

 

In your case, dynamic requests are caching nothing but you have a rule in a dispatcher config to cache the request with query parameter.

Please do have a check for the below rule and make you have not enabled the caching for query param.

 

/ignoreUrlParams
{
    /0001 { /glob "*" /type "deny" }
}

 

The above rule will disable the caching a request which has a query parameter.

Make sure you have not enabled caching by adding  /0002 { /glob "*" /type "allow" } to ignoreUrlParams.

 

For more details please check the document below.

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

Avatar

Avatar
Give Back 5
Employee
vanegi
Employee

Likes

392 likes

Total Posts

378 posts

Correct Reply

148 solutions
Top badges earned
Give Back 5
Give Back 3
Give Back 10
Give Back
Boost 50
View profile

Avatar
Give Back 5
Employee
vanegi
Employee

Likes

392 likes

Total Posts

378 posts

Correct Reply

148 solutions
Top badges earned
Give Back 5
Give Back 3
Give Back 10
Give Back
Boost 50
View profile
vanegi
Employee

14-07-2020

Hi @vijays80591732,

Ideally it's not possible to cache the requests that contain query string. Such calls are considered dynamic therefore it should not be expected to cache them.

 

Here in your case, it looks like the query params [q] is getting cached, I think the config /ignoreUrlParams is what you are looking for. It can be used to white list the query parameters which are used to determine whether a page is cached / delivered from cache or not.
 
 
And then add the following rule:
 
/ignoreUrlParams
{
    /0001 { /glob "*" /type "deny" }
}

Please make sure that the following rule /0002 { /glob "q" /type "allow" } is not set under /ignoreUrlParams. If so, remove the rule and restart the Apache web-server after making these modification.

 

Thanks,

Vaishali