Heroku 缓存内容在fastly CDN上过期太频繁

Heroku 缓存内容在fastly CDN上过期太频繁,heroku,fastly,Heroku,Fastly,我在Heroku应用程序前面使用Fastly作为CDN,并且看到许多我希望缓存的请求都通过了 此行为的一个示例是对URL的两个请求: . 以下是两个请求的响应,间隔15分钟: RESPONSE 1: ---------- Strict-Transport-Security: max-age=31536000 Content-Encoding: gzip X-Content-Type-Options: nosniff Age: 0 Transfer-Encoding: chunked X-Cach

我在Heroku应用程序前面使用Fastly作为CDN,并且看到许多我希望缓存的请求都通过了

此行为的一个示例是对URL的两个请求: . 以下是两个请求的响应,间隔15分钟:

RESPONSE 1:
----------
Strict-Transport-Security: max-age=31536000
Content-Encoding: gzip
X-Content-Type-Options: nosniff
Age: 0
Transfer-Encoding: chunked
X-Cache: MISS
X-Cache-Hits: 0
Content-Disposition: inline; filename="file.jpg"
Connection: keep-alive
Via: 1.1 vegur
Via: 1.1 varnish
X-Request-Id: bc766069-c2ca-4a66-ba88-a8d76da72e2d
X-Served-By: cache-sjc3124-SJC
X-Runtime: 3.711698
Last-Modified: Tue, 23 Jun 2015 18:44:27 GMT
Server: Cowboy
X-Timer: S1435085062.909546,VS0,VE4437
Date: Tue, 23 Jun 2015 18:44:27 GMT
Vary: Accept-Encoding
Content-Type: image/jpeg
Access-Control-Allow-Origin: *
Cache-Control: public, must-revalidate, max-age=31536000
Set-Cookie: __profilin=; path=/; max-age=0; expires=Thu, 01 Jan 1970 00:00:00 -0000; secure
Accept-Ranges: bytes
Expires: Wed, 22 Jun 2016 18:44:27 GMT
----------
RESPONSE 2:
----------
Strict-Transport-Security: max-age=31536000
Content-Encoding: gzip
X-Content-Type-Options: nosniff
Age: 0
Transfer-Encoding: chunked
X-Cache: MISS
X-Cache-Hits: 0
Content-Disposition: inline; filename="file.jpg"
Connection: keep-alive
Via: 1.1 vegur
Via: 1.1 varnish
X-Request-Id: 60ee54b0-9509-42c5-9b03-c0f5854c5524
X-Served-By: cache-sjc3135-SJC
X-Runtime: 0.251021
Last-Modified: Tue, 23 Jun 2015 18:57:44 GMT
Server: Cowboy
X-Timer: S1435085863.749442,VS0,VE560
Date: Tue, 23 Jun 2015 18:57:44 GMT
Vary: Accept-Encoding
Content-Type: image/jpeg
Access-Control-Allow-Origin: *
Cache-Control: public, must-revalidate, max-age=31536000
Accept-Ranges: bytes
Expires: Wed, 22 Jun 2016 18:57:44 GMT
这两个都是缓存未命中,尽管我预计这些内容将被缓存一年。看起来同样的Fastly集群也处理了请求。有人能指出我可能做错了什么吗?我在Fastly提供的许多文件中都看到了这种行为——Fastly似乎间歇性地提供文件,但缓存未命中的频率比我预期的要高得多


我很感激任何人能在这方面给我的帮助-谢谢

如果查看响应中的HTTP头,您将看到它们都包含
Set Cookie
头。Fastly不会缓存带有cookie的响应。但是,您可以在应用程序或Fastly配置中删除它们