使用资产管道以开发模式缓存Javascript [英] Javascript is cached in development mode with asset pipeline
问题描述
我最近将我的应用程序升级到了Rails 3.1,通常一切似乎都可以正常工作,但是有一件事使我发疯.
I recently upgraded my application to rails 3.1 and generally everything seems to be working but one thing is driving me insane.
我有2个主要的js文件,我们将它们分别命名为application.js和main.js.
I have 2 main js files, we'll call them, application.js and main.js.
application.js包含我的清单文件,并正在main.js中加载.很好我的问题是,当我处于开发模式时,我对main.js进行了更改,然后刷新了该页面,该站点未进行更改.为了进行更改,我已经重新启动了Rails服务器.
application.js has my manifest stuff in it and is loading in main.js. That's working fine. My problem is when i'm in development mode and i make a change to main.js, then refresh the page the site doesn't pick up the change. In order to pull in the change I have restart the rails server.
我在开发中打开了调试模式,但是我想知道是否还有其他设置丢失?
I have debug mode turned on in development, but I'm wondering if there's another setting i'm missing?
有人遇到过吗?
推荐答案
我遇到了同样的问题,但是config.action_controller.perform_caching
已经设置为false.
I had the same issue, but config.action_controller.perform_caching
was already set to false.
对于我和与我一起工作的另一个人,问题在于尽管Rails中进行了设置,Chrome仍在缓存页面.
For me and another guy I was working with, the problem was that Chrome was caching the page despite the settings in Rails.
要修复此问题,我们只是关闭了标签页,打开了一个新标签页,然后再次访问了该网站.
To fix it, we just closed the tab, opened a new tab, and visited the site again.
这篇关于使用资产管道以开发模式缓存Javascript的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!