如何防止早午餐手表上的缓存

时间:2013-05-09 06:20:32

标签: brunch

我正在构建一个ember应用程序,并且发现我经常需要重新启动brunch watch -s命令才能更新我的应用程序。虽然早午餐会在每次更改时重新编译,但只有重新启动命令才能完成更改。

我做错了吗?有没有解决这个问题的方法?

注意:浏览器缓存已关闭

更新:我想出了如何调试早午餐;)我发现以下内容:

 brunch:common Writing file 'public/javascripts/app.js' +14s
29 May 20:47:46 - info: compiled in 73ms
 brunch:watch File 'app/templates/contact.hbs' received event 'change' +3s
 brunch:file-list Compiled file 'app/templates/contact.hbs' +3s
 brunch:generated-file Joining files 'app/app.js, app/controllers/contact.js, app/initialize.js, app/models/category.js, app/models/marker.js, app/models/stock.js, app/routes/application.js, app/routes/category/index.js, app/routes/contact.js, app/templates/about.hbs, app/templates/application.hbs, app/templates/blog.hbs, app/templates/categories.hbs, app/templates/category.hbs, app/templates/category/index.hbs, app/templates/contact.hbs, app/templates/contactEntry.hbs, app/templates/index.hbs, app/templates/new.hbs, app/templates/specials.hbs, app/views/contact.js, app/views/contactEntry.js' to 'public/javascripts/app.js' +3s
 brunch:common Writing file 'public/javascripts/app.js' +3s
29 May 20:47:50 - info: compiled in 73ms
 brunch:watch File 'app/templates/contact.hbs' received event 'unlink' +6s
29 May 20:47:57 - info: compiled in 67ms
 brunch:watch File 'app/templates/contact.hbs' received event 'add' +99ms
 brunch:source-file Initializing fs_utils.SourceFile: {"path":"app/templates/contact.hbs","isHelper":false,"isVendor":false} +10s
 brunch:file-list Compiled file 'app/templates/contact.hbs' +6s
 brunch:generated-file Joining files 'app/app.js, app/controllers/contact.js, app/initialize.js, app/models/category.js, app/models/marker.js, app/models/stock.js, app/routes/application.js, app/routes/category/index.js, app/routes/contact.js, app/templates/about.hbs, app/templates/application.hbs, app/templates/blog.hbs, app/templates/categories.hbs, app/templates/category.hbs, app/templates/category/index.hbs, app/templates/contact.hbs, app/templates/contactEntry.hbs, app/templates/index.hbs, app/templates/new.hbs, app/templates/specials.hbs, app/views/contact.js, app/views/contactEntry.js' to 'public/javascripts/app.js' +6s
 brunch:common Writing file 'public/javascripts/app.js' +6s

请注意,有时它会收到unlink事件,但之后不会重建文件。我通过对contact.hbs文件进行小的更改来测试它。为什么服务器有时会重建,有时候不会重建?

1 个答案:

答案 0 :(得分:1)

从我的discussion with Paul Miller开始,这在1.7.0之前已经修复,很快就会发布