How to specify the ETag algorithm used for asset fingerprinting in Play without using third-party plugins?
For example, specify that the ETag is to be the environment variable BUILD_NUMBER
, the GitHub revision number of the file, and its time/date? To know how to do the GitHub revision bit would be really great. :)
Related questions: Embed ETag in URL & Automatically Insert ETag (asset fingerprinting) as comment at top of the resource
At present there is no configuration possibility to specify what ETag algorithm to use with the Play API.
The
Assets
class can be extended and overridden to keep all the benefits of the aggressive caching that Play does when changing the ETag algorithm.The
BUILD_NUMBER
can be passed in to the algorithm and the GitHub API can be used to obtain the revision number for any file.