How can I tell to GlassFish server, to store all JS, CSS and PNG files into browser cache in order to reduce HTTP GET requests?
I am using JSF and PrimeFaces.
Just make use of JSF builtin resource handler. I.e. use /resources folder instead of "plain vanilla" , and .
This way you don't need to worry about resource caching at all. JSF builtin resource handler has already set the necessary response headers. The expiration time defaults already to 1 week.
In Mojarra you can control the expiration time by the following context parameter (the value is in millis):
com.sun.faces.defaultResourceMaxAge
3628800000
And in MyFaces:
org.apache.myfaces.RESOURCE_MAX_TIME_EXPIRES
3628800000