We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 32b878d + af39995 commit 242ddfcCopy full SHA for 242ddfc
etc/vcl_snippets/fetch.vcl
@@ -26,6 +26,12 @@
26
27
}
28
29
+ # Force caching for signed cached assets.
30
+ if (req.http.x-long-cache) {
31
+ set beresp.ttl = 31536000s;
32
+ set beresp.http.Cache-Control = "max-age=31536000";
33
+ }
34
+
35
if (beresp.http.Content-Type ~ "text/(html|xml)") {
36
# enable ESI feature for Magento response by default
37
esi;
etc/vcl_snippets/recv.vcl
@@ -4,9 +4,12 @@
4
set req.url = re.group.2;
5
6
7
+ unset req.http.x-long-cache;
8
9
# Rewrite /static/versionxxxxx URLs. Avoids us having to rewrite on nginx layer
10
if (req.url ~ "^/static/version(\d*/)?(.*)$") {
11
set req.url = "/static/" + re.group.2 + "?" + re.group.1;
12
+ set req.http.x-long-cache = "1";
13
14
15
# User's Cookie may contain some Magento Vary items we should vary on
0 commit comments