用于资产指纹识别的自定义ETag算法 [英] Custom ETag algorithm for asset fingerprinting
问题描述
如何在不使用第三方插件的情况下指定Play中用于资产指纹识别的ETag算法?
How to specify the ETag algorithm used for asset fingerprinting in Play without using third-party plugins?
例如,指定ETag是环境变量BUILD_NUMBER
,文件的GitHub版本号及其时间/日期?知道如何做GitHub修订版确实很棒. :)
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. :)
相关问题:在URL中嵌入ETag & 将ETag(资产指纹)自动插入为在资源顶部发表评论
Related questions: Embed ETag in URL & Automatically Insert ETag (asset fingerprinting) as comment at top of the resource
推荐答案
当前没有配置可能性来指定要与Play API一起使用的ETag算法.
At present there is no configuration possibility to specify what ETag algorithm to use with the Play API.
Assets
类,以保留Play更改ETag算法时进行的主动缓存的所有优点.
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.
BUILD_NUMBER
可以传递给算法,并且 GitHub API 可以用于获取任何文件的修订号.
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.
这篇关于用于资产指纹识别的自定义ETag算法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!