【问题标题】:Rails static assets not caching with CloudFlareRails 静态资产不使用 CloudFlare 缓存
【发布时间】:2018-05-19 03:39:14
【问题描述】:

我在 Heroku 上有一个激活了 CloudFlare 的 Rails 4.2.10 站点。但是,CloudFlare 不断报告我的静态资产的 MISS。 CloudFlare 一直没有帮助。有什么想法吗?

网址:https://www.eventingvolunteers.com/

Request URL:https://www.eventingvolunteers.com/assets/application-c5697db660693224e57f66260130bdeb07762900fb1b56009477833c84c6c589.js
Request Method:GET
Status Code:200  (from memory cache)
Remote Address:104.27.157.140:443
Referrer Policy:no-referrer-when-downgrade
Response Headers
cache-control:public, max-age=31536000
cf-cache-status:MISS
cf-ray:3c3d502a79045735-IAD
content-encoding:br
content-type:application/javascript
date:Sun, 26 Nov 2017 13:49:48 GMT
expires:Mon, 26 Nov 2018 13:49:48 GMT
last-modified:Sun, 26 Nov 2017 13:47:31 GMT
server:cloudflare-nginx
status:200
vary:Accept-Encoding
via:1.1 vegur
Request Headers
Provisional headers are shown

【问题讨论】:

    标签: ruby-on-rails caching heroku asset-pipeline cloudflare


    【解决方案1】:

    此 js 文件是从您的浏览器缓存中提供的,因此 CF 缓存状态为 MISS

    在重新加载时禁用浏览器中的缓存,cf-cache-status 将被 HIT

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-09-02
      • 2023-03-04
      • 2023-03-26
      • 1970-01-01
      • 1970-01-01
      • 2015-08-19
      • 1970-01-01
      • 2011-10-21
      相关资源
      最近更新 更多