How dispatcher caches page with query params in url | Community
Skip to main content
prohira
Level 3
October 16, 2015
Solved

How dispatcher caches page with query params in url

  • October 16, 2015
  • 4 replies
  • 9505 views

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.

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 gopalKa

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 

4 replies

Lokesh_Shivalingaiah
Level 10
October 16, 2015

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

Peter_Puzanovs
Community Advisor
Community Advisor
October 16, 2015

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

gopalKaAdobe EmployeeAccepted solution
Adobe Employee
October 16, 2015

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 

Scott_Brodersen
Level 8
October 16, 2015

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