If you enable parameter filtering, Alibaba Cloud CDN nodes remove the parameters (query
strings) that follow the question mark (?
) in request URLs. These parameters contain information such as the user identity
and request source. The original URLs are used as the cache keys. This topic describes
how to configure parameter filtering.
Overview
- Ignore parameters
Description Scenario Alibaba Cloud CDN removes the parameters that follow the question mark ( ?
) in request URLs so that requests that are destined for the same file but carry different URL parameters can hit the cache. Parameter filtering increases the cache hit ratio, reduces the back-to-origin routing frequency, and accelerates file distribution.Some users append parameters after the question mark ( ?
) in request URLs to pass information such as the user ID (UID), request source, and recommendation code to the origin server. In this case, these URLs carry different query strings even if the requests are sent to the same file.We recommend that you enable parameter filtering if the parameters that follow the question mark (?
) in URLs are irrelevant to the requested resource. Example:- Request from user A:
http://example.com/1.jpg?uid=123***
- Request from user B:
http://example.com/1.jpg?uid=654***
After parameter filtering is enabled, the CDN node removes the UIDs that follow the question mark (
?
) in the request URLs. The final URLhttp://example.com/1.jpg
is used to match the cache. - Request from user A:
- Retain parameters in back-to-origin requests
Description Scenario The original URLs are redirected to the origin server so that key user information can be passed to the origin server. If you enable parameter filtering, CDN nodes redirect the URLs processed by parameter filtering to the origin server. In the preceding example, the requests from user A and user B both use the URL http://example.com/1.jpg
. The UIDs are not passed to the origin server during back-to-origin routing.If you choose to retain parameters in back-to-origin requests, CDN nodes redirect the original URLs to the origin server so that the UIDs are passed to the origin server.
