Query params¶
This page will show you steps to configure query-parameter based condition. These then can be used at multiple places such as rewrite/caching/blocking rules.
Typical use-case is, you would want to cache and serve-from cache while ignoring the marketing/tracking query parameters (e.g. utm_, fbclid, gclid etc.). Which will also create less cache-variations, and improve the cache-HIT percentage.
Note: For demo purpose, we will be using www.nviztest.com
domain as an example. Here, we will create a query-param condition with regex pattern (utm_|fbclid|gclid)
to be used to ignore them while caching/serving-from-cache.*
Prerequisite¶
- You must have a domain configured on Nitrogen.
Steps¶
-
Click on
Settings
menu, and openQuery Params
tab.
-
Create condition by clicking on
Create
button.
You will now be taken to a screen to provide query-parameter condition details.-
Group Name
: Provide short name about the query-parameter condition you are creating. For now, putExcluding campaign and tracking query params
here. Note: Please keep the name meaningful and relevant. -
Query Param Name
: Enter query-parameter name or regex. We will be putting(utm_|fbclid|gclid)
here Note: query-parameters name is matched as regex. Therefore all the query-parameters with name matching given regex will match here. For absolute names you can use ^ and \$ in regex e.g. ^shopid$ -
Match if query param is not present
: Switch this flag on if you only wish to match when given query-parameter is not present. Enable it in this case for now.
-
-
Click on
Save
button. The configured pattern will be showed inQuery Params
list.
You can now use it in Cache-Variations
to replace Vary on all query parameters
condition.