鍍金池/ 問答/Java/ spring boot 里的靜態(tài)資源,修改后如何自動(dòng)更新?

spring boot 里的靜態(tài)資源,修改后如何自動(dòng)更新?

使用eclipse開發(fā)spring boot。修改js文件后,每次需要手動(dòng)project->clean一下,并且勾選了project->build automatically,安裝了spring-boot-devtools插件,也不好用。

確定不是瀏覽器緩存。請問有沒有什么解決辦法?

回答
編輯回答
嘟尛嘴

1.application.yml添加cache-period: 0

resources: # 指定靜態(tài)資源的路徑
        static-locations: classpath:/static/,classpath:/views/
        cache-period: 0

2.勾選project->build automatically
3.去掉spring-boot-devtools插件!

2017年8月7日 18:53
編輯回答
你好胸

改用idea,idea大法好?

2017年4月6日 21:53