Question

I'm trying to set a future Expires Cache on public assets as per YSlow guidelines, to enable loading from cache and improve performance a bit.

As per documentation (see Cache-Control at the bottom) this should work:

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

But it doesn't, when I check the Response I get:

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)

My file is stored under /public/javascripts/bootstrap.min.js

My routes entry is the default one:

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

It seems that the config should work if I read the source code for assets.

Any idea on what I'm missing or how to make it work?

Was it helpful?

Solution

Issue solved: the browser was retrieving the elements from it's own cache and wasn't updating the Expires entry.

After not using the project for couple of hours and without any changes, it worked.

Oh, well...

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top