I run the application with Play and Java, and I need to set the expiration date for various types of assets: images, css, javascript, etc.
The conf / routes file has the following:
GET /assets/*file controllers.Assets.at(path="/public", file)
I managed to set the expiration date for one separate file in application.conf :
"assets.cache./public/js/pages/validation.js"="max-age=7200"
But I can not install it for the entire folder. I tried
"assets.cache./public/js/pages/*.js"="max-age=7200" "assets.cache./public/js/pages/*"="max-age=7200"
but nothing happens. I was hoping to set an expiration date for everything in the / js / pages folder.
I also tried
assets.defaultCache="max-age=7200"
according to the instructions at http://www.jamesward.com/2014/04/29/optimizing-static-asset-loading-with-play-framework
and
http.cacheControl=7200
to the documentation http://www.playframework.com/documentation/1.2.3/configuration#http
and not one of these works. The changes above were made in application.conf.
I know that there is a way to do the same by specifying controllers that change the answer () for the routes I want to set the expiration date for: Far future Expires header for static content
But I would like to know how to set the expiration date for the assets from the application.conf file.
Our application runs on S3 Linux instances, so setting an expiration date on the server is not an option.
Thanks!
sempervirescent
source share