Expand my Community achievements bar.

Submissions are now open for the 2026 Adobe Experience Maker Awards.
SOLVED

AEMaaCS: how do I cache pages that uses query params?

Avatar

Level 9

Basically I'm trying to cache historical data since it's not going to chance anymore.

 

2 questions please

1. how do I configure the dispatcher so it caches query parameter?

 

2. How can I cache these pages for X days (considering they are historical and not going to change anymore. It'll only be used for reporting.

 

-----------

 

So I have the following in my dispatcher config. reading various references it seems it should work but I cannot test it locally.

/ignoreUrlParams {
/0001 { /glob "*" /type "deny" }

/4441 { /glob "year=2024" /type "allow" }
/4442 { /glob "year=2023" /type "allow" }
/4443 { /glob "year=2022" /type "allow" }
/4444 { /glob "year=2021" /type "allow" }
/4445 { /glob "year=2020" /type "allow" }
/4446 { /glob "year=2019" /type "allow" }
/4447 { /glob "year=2018" /type "allow" }
/4448 { /glob "year=2017" /type "allow" }
/4449 { /glob "year=2016" /type "allow" }
/4410 { /glob "year=2015" /type "allow" }
/4411 { /glob "year=2014" /type "allow" }
}

 

1 Accepted Solution

Avatar

Correct answer by
Level 10

hi @jayv25585659,

Currently, the dispatcher can cache one version of the product.html page, which will be the same for both year=2019 and year=2018. For more information, please refer to the Adobe documentation at here and look for the "ignoreUrlParams" section.

 

If you want to cache different versions of the page for year=2019 and year=2018, you can implement a rewrite rule that converts the URL to a selector-based format. For example, you can change the URL from www.abc.com/en/product.html?year=2020 to www.abc.com/en/product.year.2020.html or www.abc.com/en/product.2020.html.

Additionally, the rewrite rule is not mandatory. For instance, you can change the product page implementation from using a URL parameter to a selector-based logic.

 

View solution in original post

3 Replies

Avatar

Correct answer by
Level 10

hi @jayv25585659,

Currently, the dispatcher can cache one version of the product.html page, which will be the same for both year=2019 and year=2018. For more information, please refer to the Adobe documentation at here and look for the "ignoreUrlParams" section.

 

If you want to cache different versions of the page for year=2019 and year=2018, you can implement a rewrite rule that converts the URL to a selector-based format. For example, you can change the URL from www.abc.com/en/product.html?year=2020 to www.abc.com/en/product.year.2020.html or www.abc.com/en/product.2020.html.

Additionally, the rewrite rule is not mandatory. For instance, you can change the product page implementation from using a URL parameter to a selector-based logic.

 

Avatar

Level 9

unfortunately, the rewrite rules has been in such a way to match an existing site.

 

RewriteRule ^/staff/([0-9]+)/address/([0-9]+)$ /content/myapp/sg/en/staff/address.html?id=$1&addressid=$2 [PT,L,QSA]

Avatar

Level 10

You can add as many additional rules as needed, as long as they do not conflict with one another. In fact, the same dispatcher can manage multiple site domains without any issues. This often occurs with large clients that have multiple sites online.