Skip to main content
prohira
Level 3
Oct 16, 2015 2:27 AM UTC
Solved

How dispatcher caches page with query params in url

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.
gopalKaAccepted solution
Adobe Employee
Oct 16, 2015 2:27 AM UTC

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

Scott_Brodersen
Level 8
Oct 16, 2015 2:27 AM UTC

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

Translate
gopalKaAdobe EmployeeAccepted solution
Adobe Employee
Oct 16, 2015 2:27 AM UTC

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 

Translate
Peter_Puzanovs
Community Advisor
Community Advisor
Oct 16, 2015 2:27 AM UTC

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

Translate
Lokesh_Shivalingaiah
Level 10
Oct 16, 2015 2:27 AM UTC

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

Translate