GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing wikitech.wikimedia.org — Query string normalization - Wikitech ProblemThe following two URLs are different from the point of view of the caching software running on a CDN node (ATS, Varnish) but represent the same page:
To make optimum use of cache resources, we want to normalize these requests so they have a single canonical form. We do this by sorting query parameters in Varnish. TheoryApplications are generally insensitive to the order of query parameters, but there is a class of edge-cases that have to do with query parameter keys that appear multiple time in a query string. The way applications handle these varies:
The way to handle all such cases correctly (i.e., ensure that the re-ordering of query parameters is transparent to the backend application) is to preserve duplicate parameters and to use a stable sort that maintains their relative order. There are some additional subtleties related to PHP array syntax and URL encoding. See the test cases for libvmod-querysort. MediaWikiIn its default configuration, the CDN expiry code in MediaWiki is sensitive to parameter ordering. Specifically, MediaWiki allows the full This form is a problem because it places ImplementationVarnishQuery parameter normalization is done in Varnish using a custom vmod, libvmod-querysort. The code in this vmod is a fork of Varnish's std.querysort, modified to make the sort stable and to handle PHP array syntax correctly. If you are porting this code to another caching platform, make sure the new implementation passes the same test cases. Query normalization was rolled out in August 2022. Purgedpurged sorts query parameters as well. This was implemented (Ia6b494662) as a stop-gap when we realized that purge requests are handled by ATS and don't get rewritten by Varnish. A better solution is to apply query string normalization in ATS. Some notes about how to do that are available in task T317064 comment 8213291. See also
|
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |