View grace.vcl
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
# conditional grace for healthy/unhealthy (30s/1h) | |
vcl 4.0; | |
import std; | |
sub vcl_hit { | |
if (std.healthy(req.backend_hint) && obj.ttl + 30s < 0s) { | |
return(fetch); | |
} |
View hit_miss.vcl
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; | |
#put this near the top of the parent vcl: | |
#include "hit_miss.vcl"; | |
sub vcl_hit | |
{ | |
set req.http.X-status = "HIT"; | |
set req.http.X-ttl = obj.ttl; | |
set req.http.X-grace = obj.grace; |
View s3.vcl
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
# | |
# Varnish AWS S3 Gateway VCL | |
# | |
# Allows global read (GET, HEAD) and ACL protected writes (POST, PUT, DELETE). | |
# When writing, pass in Content-Type and Content-MD5, both are optional. | |
# | |
# Params: | |
# | |
# %BUCKET% - S3 bucket name, S3 host may be regional | |
# %ACCESS_ID% - IAM access ID for bucket |
View write_retry.vtc
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 "PUT/POST/DELETE retry" | |
server s1 { | |
rxreq | |
delay 0.5 | |
txresp | |
} -start | |
varnish v1 -vcl+backend { | |
sub vcl_backend_fetch { |
View calc_memory.sh
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
#!/bin/bash | |
if [ "$1" = "" ] | |
then | |
echo "Pass in a PID" | |
exit 1 | |
fi | |
SMAPS=/proc/$1/smaps |
View code.c
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
# this is a comment | |
int i = 0; | |
foo(); | |
i++; |
View cedexis.vcl
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
/* | |
* Cedexis test object location: L34, L39 | |
* | |
* Requires vmod null: | |
* https://github.com/varnish/libvmod-null | |
* | |
*/ | |
vcl 4.0; |
View edgestash_json.vcl
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; | |
# Edgestash | |
# VCL generated JSON variables | |
# | |
# /edgestash/test/1 template contents: | |
# Hello {{name}} {{test}}! | |
backend default | |
{ |
View m00026.vcl.c
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
/* ---===### include/vdef.h ###===--- */ | |
/*- | |
* Copyright (c) 2006 Verdens Gang AS | |
* Copyright (c) 2012 Fastly Inc | |
* Copyright (c) 2006-2015 Varnish Software AS | |
* All rights reserved. | |
* | |
* Author: Poul-Henning Kamp <phk@phk.freebsd.dk> | |
* Author: Rogier 'DocWilco' Mulhuijzen <rogier@fastly.com> |
View wordpress.vcl
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
# Worldpress Varnish Cache VCL template | |
# 12/21/2016 | |
vcl 4.0; | |
backend wordpress { | |
.host = "0.0.0.0"; | |
.port = "0"; | |
} |
OlderNewer