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

SOLVED

How dispatcher caches page with query params in url

prohira
Level 4
Level 4

I know there is a way to cache pages in dispatcher even with query params in URL thru ignoreUrlParams section in dispatcher.any file.

My question is: Let's say I have two URLs www.abc.com/en/product.html?q=1 and www.abc.com/en/product.html?q=2. I know it's not recommended to cache pages in dispatcher where output is dependent on query param. But if I do it, how this page will be stored in dispatcher cache?

Thanks.

1 Accepted Solution
kalyanar
Correct answer by
Employee
Employee

As you mentioned in your question, currently dispatcher has capability to cache one copy of product.html which will be same for q=1 and q=2. Please refer to https://docs.adobe.com/docs/en/dispatcher/disp-config.html ad look for ignoreUrlParams . 

If you want to cache different copies for q=1 and q=2, then only way is to write a rewrite rule that converts this url to selector based or suffix based url. For ex., www.abc.com/en/product.html?q=1 to www.abc.com/en/product.html/q.1.html  or www.abc.com/en/product.1.html 

View solution in original post

4 Replies
bsloki
Community Advisor
Community Advisor

As you said, technically its not recommended and havent tried it. However, all the pages are cached to the location specified in the /docroot attribute of the /cache section in the dispatcher.any file

PuzanovsP
Community Advisor
Community Advisor

It's cached as a single page. e.g. one copy.

It's also important to remember that when q=1 and 1=2 produce different results. The page that got invoked first will produce the output that will be later presented regardless of parameter supplied.

Peter

kalyanar
Correct answer by
Employee
Employee

As you mentioned in your question, currently dispatcher has capability to cache one copy of product.html which will be same for q=1 and q=2. Please refer to https://docs.adobe.com/docs/en/dispatcher/disp-config.html ad look for ignoreUrlParams . 

If you want to cache different copies for q=1 and q=2, then only way is to write a rewrite rule that converts this url to selector based or suffix based url. For ex., www.abc.com/en/product.html?q=1 to www.abc.com/en/product.html/q.1.html  or www.abc.com/en/product.1.html 

View solution in original post

Scott_Brodersen
Level 8
Level 8

PuzanovsP wrote...

It's cached as a single page. e.g. one copy.

It's also important to remember that when q=1 and 1=2 produce different results. The page that got invoked first will produce the output that will be later presented regardless of parameter supplied.

Peter

 

I added this to the docs... thanks. 

http://docs.adobe.com/docs/en/dispatcher/disp-config.html#Ignoring%20URL%20Parameters

scott