Acting on the Query String
Last updated
Was this helpful?
Last updated
Was this helpful?
At Transparent Edge, we implement , and therefore you can take advantage of all the benefits it offers.
In this case, we will discuss how to use the module in Transparent Edge to interact with the query string of a web request.
You may want to normalize the URL, particularly its parameters. For example, the order in which they arrive may be important to increase , and you may want to ensure that the URL parameters always arrive in the same order regardless of the site from which they are called
In any case, if you don't want to sort it, you just need to do the following:
Sometimes it may be necessary to remove certain parameters from the query string that arrives at Transparent CDN in order to improve cache effectiveness or simply because we want the URL to be sent to the origin without a specific parameter. One way to do this is as follows, in this case, we are removing a parameter named random:
Just like the previous example, you may be interested in removing one or multiple parameters from the query string based on a regular expression. For example, we can remove all the parameters added by Google Analytics:
Other functions that can be useful to you are:
query_keep. to remove all the query string except for a specific parameter.
query_get. to retrieve the value of a parameter from the query string.
tolower. to convert the entire URL to lowercase.
toupper. to convert the entire URL to uppercase.
query_add. to add a parameter to the URL.
You can find the complete documentation of this module at the following