即使在开发中,Rails资产也会被缓存

时间:2013-08-06 14:43:19

标签: ruby-on-rails asset-pipeline

这是我的Development.rb文件

  # In the development environment your application's code is reloaded on
  # every request. This slows down response time but is perfect for development
  # since you don't have to restart the web server when you make code changes.
  config.cache_classes = false

  # Log error messages when you accidentally call methods on nil.
  config.whiny_nils = true

  # Show full error reports and disable caching
  config.consider_all_requests_local       = true
  config.action_controller.perform_caching = false
  config.assets.digest = true
  config.serve_static_assets = false

出于某种原因,即使在开发环境中,我的CSS文件也被缓存,我无法弄清楚为什么

2 个答案:

答案 0 :(得分:3)

遇到类似的问题:javascript文件是由rails服务器缓存的

解决方案(如TheIrishGuy所述):

  1. 停止Rails服务器
  2. $ rake tmp:cache:clear
  3. 启动Rails服务器
  4. 浏览器中的Crtl + F5

答案 1 :(得分:1)

您是否预先编译了任何资产?如果是,请检查公共资产文件夹并删除。

尝试清除/ tmp / cache / assets

确保浏览器没有缓存application.css,强制刷新等