CNode

express eTag 模块是干什么的了,没读懂

问答
Sslclub发布于10 年前最后回复10 年前5 回复6780 浏览0 收藏

etag源码地址

这个模块主要干什么的; 以及怎么工作的 求大神解析

etag(entity, [options])

Generate a strong ETag for the given entity. This should be the complete body of the entity. Strings, Buffers, and fs.Stats are accepted. By default, a strong ETag is generated except for fs.Stats, which will generate a weak ETag (this can be overwritten by options.weak).

res.setHeader('ETag', etag(body))

查看回复

回复 (5)

I
i5ting#2·10 年前

去搜一下alsotang的一篇缓存的文章

S
slclub#3·10 年前

@i5ting @htoooth 非常感谢,

S
slclub#4·10 年前
J
jiangzhuo#5·10 年前

RFC 7232

参与回复
登录后即可参与回复。登录