A general-purpose querystring manipulation module for Varnish
Switch branches/tags
Pull request Compare This branch is 159 commits behind Dridi:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
m4
src
.gitattributes
.gitignore
INSTALL
LICENSE
Makefile.am
README.rst
autogen.sh
configure.ac

README.rst

vmod_querystring

Varnish QueryString Module

Author: Dridi Boukelmoune
Date: 2012-06-18
Version: 0.1
Manual section:3

SYNOPSIS

import querystring;

DESCRIPTION

Varnish multi-purpose vmod for URI query-string manipulation. Can be used to normalize for instance request URLs or Location response headers in various ways. It is recommended to at least clean incoming request URLs (removing empty query-strings), all other functions do the cleaning.

FUNCTIONS

clean

Prototype
::
clean(STRING URI)
Return value
STRING
Description
Returns The given URI with its query-string removed if empty
Example
::
set req.url = querystring.clean(req.url);

remove

Prototype
::
remove(STRING URI)
Return value
STRING
Description
Returns The given URI with its query-string removed
Example
::
set req.url = querystring.remove(req.url);

sort

Prototype
::
sort(STRING URI)
Return value
STRING
Description
Returns The given URI with its query-string sorted
Example
::
set req.url = querystring.sort(req.url);

EXAMPLE

In your VCL you could then use this vmod along the following lines:

import querystring;

sub vcl_hash {
        # sort the URL before the request hashing
        set req.url = querystring.sort(req.url);
}

COPYRIGHT

This document is licensed under the same license as the libvmod-querystring project. See LICENSE for details.

  • Copyright (c) 2012 Dridi Boukelmoune