Leo
Leo

Reputation: 160

Grails 3 Static Resource Cache Configuration

My Grails 3 website includes many static resources like js and css, I found all these static resources are set to "no-cache" and "max-age=0" by default, which cause every time reloading the page, all these static resources have to be downloaded again, this causes significant performance problem.

I am using asset-pipeline to manage these static resources in application.js and application.css, how can I configure the cache setting so that the browser can cache the static resources?

Cache

Upvotes: 1

Views: 682

Answers (1)

user1406564
user1406564

Reputation: 91

See https://github.com/grails/grails-core/issues/10410#issuecomment-273220646

Just add

grails.resources.cachePeriod: your value

to your application.yml

Upvotes: 2

Related Questions