Is there a simple, system-given way of advicing the browser to refresh each resource once after a fresh deployment of a war
-file?
I know, that a filter
can be used to set the required headers, but still I would need to implement the logic, taking care that each resource is at least refreshed once per client.
I.e. something like appending &deployment=2015-08-06-22-00-00
to EVERY (resource-)request performed? (this will make the browser cache the resources under the given parameter, thus refresh it after the next deployment, when the parameter has changed.)
Setting the No-Cache headers all the time is no option, because there is a huge amount of resources that would result in about 5 MB transfer amount (even gzip-encoded) per request.
I thought about using the "Expires" header for each resource, but unfortunatelly this would require to predict the next deployment n
, whenever the deployment n-1
is released...
Currently the best option is to set the expiry time to 1d, cause deployments usually happen during the late hours of a day. However, if the system is running without an update for several weeks, this will cause unnecessary data-transfers per day and client...