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.
Solved! Go to Solution.
Views
Replies
Total Likes
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
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
Views
Replies
Total Likes
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
Views
Replies
Total Likes
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
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
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies