简体   繁体   English

WCF REST ETag属性

[英]WCF REST ETag attribute

I have come across ETag many times when reading about WCF REST services. 在阅读有关WCF REST服务时,我多次遇到过ETag。

What are they and what are they used for? 它们是什么,它们用于什么?

The ETag value is an identifier. ETag值是标识符。

It is explained pretty well on MSDN : 它在MSDN上得到了很好的解释:

Entity Tags (or ETags) are a crucial aspect of the caching mechanisms in HTTP. 实体标签(或ETag)是HTTP中缓存机制的一个重要方面。 An ETag is an opaque quoted string that may be returned along with a response in an ETag HTTP header. ETag是一个不透明的带引号的字符串,可以与ETag HTTP标头中的响应一起返回。 ETags are used to indicate whether or not a resource has changed state. ETag用于指示资源是否已更改状态。 If two requests for the same resource result in responses with the same ETag then it can be assumed that the state of the resource has not changed between the two requests. 如果对同一资源的两个请求导致具有相同ETag的响应,则可以假设资源的状态在两个请求之间没有改变。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM