Skip to content

Varnish vmod for conditionnal (regexp driven) setting of http headers

License

Unknown, Unknown licenses found

Licenses found

Unknown
LICENSE
Unknown
COPYING
Notifications You must be signed in to change notification settings

ojdupuis/libvmod-condhdr

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

vmod_condhdr

Varnish Conditionnal Header

Author: Olivier Dupuis
Date: 2012-08-23
Version: 0.9
Manual section:3

SYNOPSIS

import condhdr;

condhdr.set(<string to test>,<regexp for test>,<header field name>,<header field value>)

DESCRIPTION

Implements conditionnal (regexp driven) setting of http header field and value. Useful when Varnish is used to set the Cache-Control headers in that case you would have many :

if (bereq.url ~ "/^/path/*.html"){
beresp.http.Cache-Control="max-age=30s";

}

it allows more compact configuration file If more than one condhdr.set is matched by string, the last one overrides the others

Thanks : mutex lock taken from : libvmod-header https://github.com/varnish/libvmod-header/

FUNCTIONS

Example VCL:: backend foo { ... };

import condhdr;

sub vcl_fetch {
condhdr.set(bereq.url,"^/path/*.html","Cache-Control","max-age=30s");

}

set

Prototype
condhdr.set(<string to test>,<regexp for test>,<header field name>,<header field value>)
Returns
void

About

Varnish vmod for conditionnal (regexp driven) setting of http headers

Resources

License

Unknown, Unknown licenses found

Licenses found

Unknown
LICENSE
Unknown
COPYING

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published