2012-02-25 49 views
3

我試圖根據YSlow指南在公共資產上設置將來的Expires緩存,以啓用從緩存加載並提高性能。如何設置未來緩存控件在Play 2.0中的資產過期

按照documentation(見底部的Cache-Control)這應該工作:

"assets.cache./public/javascripts/bootstrap.min.js"="max-age=315360000" 

但是這不,當我檢查響應我得到:

Data Size 82002 
Device disk 
Expires Thu Jan 01 1970 01:00:00 GMT+0100 (IST) 
Fetch Count 220 
Last Fetched Sat Feb 25 2012 15:04:04 GMT+0000 (GMT) 
Last Modified Sat Feb 25 2012 15:04:04 GMT+0000 (GMT) 

我的檔案儲存在/public/javascripts/bootstrap.min.js

我的路線入口是默認的:

# Map static resources from the /public folder to the /assets URL path 
GET  /assets/*file    controllers.Assets.at(path="/public", file) 

看來,如果我讀source code for assets的配置應該工作。

任何想法,我失蹤或如何使其工作?

回答

2

問題解決:瀏覽器正在從它自己的緩存中檢索元素,但未更新Expires條目。

在沒有使用該項目幾個小時,沒有任何變化後,它的工作。

哦,好吧...

相關問題