Skip to content

Commit

Permalink
https://github.com/vegandthecity/server/issues/14
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitrii-fediuk committed May 11, 2020
1 parent 4267f44 commit 82d5e22
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions etc/varnish/magento.vcl
Original file line number Diff line number Diff line change
Expand Up @@ -93,20 +93,20 @@ sub vcl_backend_response {
# 2020-05-11
# 1) «The response received from the backend, one cache misses, the store object is built from `beresp`.
# beresp
# The entire backend response HTTP data structure, useful as argument to VMOD functions.
# The entire backend response HTTP data structure, useful as argument to VMOD functions.
# Type: HTTP.
# Readable from: `vcl_backend_response`, `vcl_backend_error`.»
# https://varnish-cache.org/docs/6.1/reference/vcl.html#beresp
# 2) «beresp.grace
# Set to a period to enable grace.
# Set to a period to enable grace.
# Type: DURATION.
# Readable from: `vcl_backend_response`, `vcl_backend_error`.
# Writable from: `vcl_backend_response`, `vcl_backend_error`.»
# https://varnish-cache.org/docs/6.1/reference/vcl.html#beresp
set beresp.grace = 3d;
# 2020-05-11
# «beresp.http.*
# The HTTP headers returned from the server.
# The HTTP headers returned from the server.
# Type: HEADER.
# Readable from: `vcl_backend_response`, `vcl_backend_error`.
# Writable from: `vcl_backend_response`, `vcl_backend_error`.
Expand All @@ -115,7 +115,8 @@ sub vcl_backend_response {
if (beresp.http.content-type ~ "text") {
# 2020-05-11
# «beresp.do_esi
# Set it to true to parse the object for ESI directives. Will only be honored if req.esi is true.
# Set it to true to parse the object for ESI directives.
# Will only be honored if req.esi is true.
# Type: BOOL.
# Default: false.
# Readable from: `vcl_backend_response`, `vcl_backend_error`.
Expand All @@ -134,12 +135,21 @@ sub vcl_backend_response {
# The entire backend request HTTP data structure. Mostly useful as argument to VMODs.»
# https://varnish-cache.org/docs/6.1/reference/vcl.html#bereq
# 2) «bereq.url
# The requested URL, copied from req.url
# The requested URL, copied from req.url
# Type: STRING.
# Readable from: `vcl_pipe`, `backend`.
# Writable from: `vcl_pipe`, `backend`.»
# https://varnish-cache.org/docs/6.1/reference/vcl.html#bereq
if (bereq.url ~ "\.js$" || beresp.http.content-type ~ "text") {
# 2020-05-11
# «beresp.do_gzip
# Set to true to gzip the object while storing it.
# If http_gzip_support is disabled, setting this variable has no effect.
# Type: BOOL.
# Default: false.
# Readable from: `vcl_backend_response`, `vcl_backend_error`.
# Writable from: `vcl_backend_response`, `vcl_backend_error`.»
# https://varnish-cache.org/docs/6.1/reference/vcl.html#beresp
set beresp.do_gzip = true;
}
if (beresp.http.X-Magento-Debug) {
Expand Down

0 comments on commit 82d5e22

Please sign in to comment.