This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
varnishtest "Systematic revalidation" | |
server s1 { | |
rxreq | |
txresp -hdr "Etag: 01234" -body "foobar" | |
expect req.method == "GET" | |
rxreq | |
txresp -hdr "Etag: 01234" | |
expect req.method == "HEAD" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
varnishtest "Long vcl/backend names" | |
server s1 { | |
rxreq | |
txresp -status 301 -hdr "Location: http://bar.example.com/bar" | |
expect req.http.host == "foo.example.com" | |
expect req.url == "/foo" | |
rxreq | |
txresp -status 301 -hdr "Location: http://baz.example.com/baz" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
varnishtest "30X redirections" | |
server s1 {} | |
varnish v1 -vcl+backend { | |
sub vcl_recv { | |
if (req.http.host != "www.varnish-software.com") { | |
set req.http.location = "https://www.varnish-software.com/"; | |
return(synth(301)); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extern crate ring; | |
extern crate time; | |
use ring::digest::digest; | |
use ring::digest::SHA256; | |
fn hash(s: &[u8]) -> Vec<u8> { | |
let hasher = digest(&SHA256, s); | |
hasher.as_ref().to_vec() | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
varnishtest "416" | |
server s1 { | |
rxreq | |
send "HTTP/1.1 200 OK\r\n" | |
send "Content-length: 16\r\n" | |
send "\r\n" | |
send "012345678910" | |
delay 1 | |
send "abcdef" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
vcl 4.0; | |
import std | |
import directors | |
backend foo { | |
.host = "127.0.0.1"; | |
} | |
backend bar { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"$schema": "http://json-schema.org/draft-04/schema#", | |
"description": "Varnish Configuration Object", | |
"type": "object", | |
"required": ["backends", "rules"], | |
"properties": { | |
"backends": { | |
"description": "list of origin servers", | |
"type": "array", | |
"items": { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<title>JQVMap - World Map</title> | |
<link href="https://raw.githubusercontent.com/manifestinteractive/jqvmap/master/dist/jqvmap.css" media="screen" rel="stylesheet" type="text/css"> | |
<script type="text/javascript" src="https://code.jquery.com/jquery-1.11.3.min.js"></script> | |
<script type="text/javascript" src="https://rawgit.com/manifestinteractive/jqvmap/master/dist/jquery.vmap.js"></script> | |
<script type="text/javascript" src="https://rawgit.com/manifestinteractive/jqvmap/master/dist/maps/jquery.vmap.world.js" charset="utf-8"></script> | |
<script type="text/javascript"> | |
var g_reqs = {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server s1 { | |
rxreq | |
expect req.url == "foo" | |
txresp | |
} -start | |
varnish v1 -vcl+backend { | |
sub vcl_miss { | |
set req.http.state = "MISS"; | |
} |