Varnish in front of cgit with ESI diff fragments ================================================ Set "enable-esi=1" in cgitrc (see cgitrc(5), section EDGE SIDE INCLUDES), then include cgit-esi.vcl from your VCL: vcl 4.1; backend cgit { .host = "127.0.0.1"; .port = "8080"; } include "/etc/varnish/cgit-esi.vcl"; The included file turns on ESI processing for the commit and diff frames, hashes the esi-diff fragments on their query string so that all forks share one rendering per commit, and refuses fragment requests that do not come from the ESI processor. cgit-esi.vtc exercises the VCL with a fake cgit backend: varnishtest -D cgit_vcl=$PWD/cgit-esi.vcl cgit-esi.vtc