From 1face6cb697faf95dce3002f07513ebef8af4f9a Mon Sep 17 00:00:00 2001 From: Albert Dahlin Date: Thu, 29 Jan 2015 11:17:07 +0100 Subject: [PATCH] Fixed issue with cache ttl for content-type application/json --- src/code/Cache/etc/magento.vcl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/code/Cache/etc/magento.vcl b/src/code/Cache/etc/magento.vcl index 3ce4c80..b4f3a68 100644 --- a/src/code/Cache/etc/magento.vcl +++ b/src/code/Cache/etc/magento.vcl @@ -170,6 +170,9 @@ sub vcl_fetch { # Don't cache expire headers, we maintain those differently unset beresp.http.expires; + } elsif (beresp.http.Content-Type ~ "application/json") { + set beresp.ttl = std.duration(beresp.http.X-Made-Cache-Ttl, 0s); + unset beresp.http.expires; } else { # TTL for static content set beresp.ttl = 1w;