querystring.filter_except

STRINGquerystring.filter_exceptSTRINGurlSTRINGnames

Available inall subroutines.

Returns the given URL but only keeps the listed parameters.

Example

set req.url = querystring.filter_except(req.url, "q" + querystring.filtersep() + "p");

Try it out

querystring.filter_except is used in the following code examples. Examples apply VCL to real-world use cases and can be deployed as they are, or adapted for your own service. See the full list of code examples for more inspiration.

Click RUN on a sample below to provision a Fastly service, execute the code on Fastly, and see how the function behaves.

Normalize requests to increase cache efficiency

Improve cache performance by normalizing requests. Filter and reorder query params, convert to lowercase, filter headers, and more.

Create image transform presets

Use custom, predefined classnames like large, medium, small, teaser, thumb, or article to control Fastly Image Optimizer and optionally prevent end-user access to native properties like 'width'.