From faf9bbd85dbc51d401eed984fc7d1d6d11cab520 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andre=CC=81=20R?= Date: Fri, 13 Mar 2020 16:27:25 +0100 Subject: [PATCH] [VCL] Port changes from meta repo VCL for platform.sh --- docs/varnish/vcl/varnish5.vcl | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/docs/varnish/vcl/varnish5.vcl b/docs/varnish/vcl/varnish5.vcl index 96afdb08..7ca6e60f 100644 --- a/docs/varnish/vcl/varnish5.vcl +++ b/docs/varnish/vcl/varnish5.vcl @@ -118,6 +118,19 @@ sub vcl_backend_response { // Make Varnish keep all objects for up to 1 hour beyond their TTL, see vcl_hit for Request logic on this set beresp.grace = 1h; + + // Compressing the content + if (beresp.http.Content-Type ~ "application/javascript" + || beresp.http.Content-Type ~ "application/json" + || beresp.http.Content-Type ~ "application/vnd.ms-fontobject" + || beresp.http.Content-Type ~ "application/vnd.ez.api" + || beresp.http.Content-Type ~ "application/x-font-ttf" + || beresp.http.Content-Type ~ "image/svg+xml" + || beresp.http.Content-Type ~ "text/css" + || beresp.http.Content-Type ~ "text/plain" + ) { + set beresp.do_gzip = true; + } } // Handle purge