This file contains hidden or 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
| # Edgestash VHA config | |
| vcl 6.0; | |
| import edgestash; | |
| # Look for Edgestash objects from VHA | |
| sub vcl_backend_response | |
| { |
This file contains hidden or 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 http; | |
| sub vcl_recv { | |
| // Store Varnish's local address for later use | |
| set req.http.X-prefetch = http.varnish_url(req.url); | |
| } | |
| sub vcl_backend_fetch { |
This file contains hidden or 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 "Test vary with error response" | |
| server s1 { | |
| # Normal responses | |
| rxreq | |
| txresp -hdr "Vary: test" | |
| expect req.url == "/" | |
| expect req.http.test == "1" |
This file contains hidden or 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 kvstore; | |
| # https://docs.varnish-software.com/varnish-cache-plus/vmods/kvstore-4/ | |
| sub vcl_init | |
| { | |
| kvstore.init(0, 25000); | |
| } |
This file contains hidden or 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
| // Magento 1.x VCL configuration | |
| vcl 4.0; | |
| import cookieplus; | |
| import edgestash; | |
| import kvstore; | |
| import xbody; | |
| sub vcl_init |
This file contains hidden or 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; | |
| # If you set req.http.X-aggregate = "true", Varnish will aggregate | |
| # the headers and response body into a single response block | |
| # Point this back to Varnish | |
| #backend loop { | |
| # .host = "127.0.0.1"; | |
| # .port = "80"; | |
| #} |
This file contains hidden or 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 "Test using Varnish to aggregate headers and body" | |
| server s1 { | |
| rxreq | |
| expect req.url == "/1" | |
| txresp -nolen -hdr "Content-Length: 3" | |
| delay 3 | |
| send "abc" | |
| rxreq |
This file contains hidden or 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
| # hit_miss.vcl for Varnish 6.0 | |
| vcl 4.0; | |
| # What are we, hit, miss, or pass? | |
| sub vcl_recv { | |
| set req.http.X-status = "NONE"; | |
| } |
This file contains hidden or 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 "Generate CSP nonces for Javascript" | |
| server s1 { | |
| rxreq | |
| txresp -hdr "Content-Type: text/html" -body { | |
| <html> | |
| <script> | |
| var a=1; | |
| </script> | |
| </html> |
This file contains hidden or 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 "Test JSON response body parsing" | |
| server s1 { | |
| rxreq | |
| txresp -body { | |
| { | |
| "key":"value", | |
| "key2":23 | |
| } | |
| } |