You can adjust the query string in resource URLs to optimize the node cache and load requested resources more quickly.
The query string is the string (containing one or multiple parameters separated with
? in the request URL, such as
When a node responds to a resource request, it will use the complete request URL as the cache key to match the cached resource. For example, even though the two request URLs of
https://www.example.com/images/example.jpg?time=2 have the same path, as they carry different query strings, the node will cache the
example.jpg image twice and match two node caches for the requests respectively. If the resource is not on the node, the request will be forwarded for origin-pull, which increases the origin-pull traffic.
example.jpg does not vary by query string parameters (that is,
example.jpg will match the same image even if the
time parameters are different), you can ignore the entire query string in the two request URLs to unify the requests to match the same node cache. For example, both
https://www.example.com/images/example.jpg?time=2 match the cached resource
Check the impact of the query string on resources in business resource URLs and use the query string feature to optimize the cache accordingly.
In which cases are query strings considered different?
- They have a different parameter value, such as
- They have the same parameter values but their parameters are in different orders, such as
- They have the same parameter values in different letter cases, such as
?sign=a. If you want to identify them as the same query string, you can enable the case ignoring feature.
&, they cannot be identified normally.