Make query string to be cached in dispatcher | Community
Skip to main content
Level 2
July 13, 2018
Solved

Make query string to be cached in dispatcher

  • July 13, 2018
  • 8 replies
  • 7175 views

Hi,

I'm trying to make the query string to be cached in dispatcher in separated files. Have read an article about Configuring Dispatcher, I tried

/ignoreUrlParams { /0003 { /glob "*" /type "allow" } }

but it keeps caching one files instead of multiple files as I'm trying to used many queries. For example:

I tried: mywebsite.com/homepage.html?x=1 and mywebsite.com/homepage.html?y=2, but the cache only have homepage.html

Is there any way to make multiple caches by different queries?

Any help would be appreciated.

My apache version is 4.2.2.

Many thanks,

Manh

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 Feike_Visser1

I would more do something like homepage.y.3.html

8 replies

kautuk_sahni
Community Manager
Community Manager
July 13, 2018

The ignoreUrlParams setting ignores the query string and caches the page as if the query string wasn't in the URL. Normally the ignoreURLParameters is used to impact query parameters that don't impact the HTML to be returned, but rather impact the display client side or are used for analytic purposes.

If you want to cache all the variations based on the query string you will have to rewrite them to selectors or something similar.

Kautuk Sahni
Level 2
July 16, 2018

Hi kautuksahni,

Thanks for your reply.

From what you suggest, you mean that I need to rewrite the url to be something like:

"mywebsite.com/homepage.html?y=2" to "mywebsite.com/homepage/y/2"

Is that correct? If so, is there any guide/document on how to do it? I'm new on configure dispatcher, so any help would be appreciated.

Thanks,

Manh

smacdonald2008
Level 10
July 16, 2018

As you are new to Dispathcer - I strongly recommend that you watch these webinars that will teach you a lot:

Optimizing the CQ Dispatcher Cache

AEM Technologists, Sept 2015 Dispatcher

ATACE July 25 2017 Advanced AEM Dispatcher Configurations

Level 2
July 17, 2018

Thanks for your reply.

From your webinars, I learned that dispatcher only cached the urls with extension (.html). So I tried

mywebsite.com/homepage.html/x/3 ---> will not be cached

mywebsite.com/homepage.html/x/3.html ---> will be cached [1]

But I have a problem, if [1] is cached, when I try to access mywebsite.com/homepage.html, it returns 404. Is it because of homepage.html is a directory, not file anymore? and is there anyway to resolved it? Appreciated for your help.

Thanks.

Feike_Visser1
Adobe Employee
Feike_Visser1Adobe EmployeeAccepted solution
Adobe Employee
July 17, 2018

I would more do something like homepage.y.3.html

Level 2
July 25, 2018

Thanks Feike.

Currently I'm doing the query string for filter, and it call the REST API service for getting the data. Is your way applied for REST API services? And Is there any document/guide on how to apply the queries for REST services?

Thanks in advanced,

Manh

MaxBarrass
Level 3
November 11, 2019

So the answer looks like it's not possible.

Dispatcher caches assets and html files. Caching query string could create a DDOS scenario.

joerghoh
Adobe Employee
Adobe Employee
November 12, 2019

Actually caching a query string is forbidden by the HTTP RFCs.