[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 493
  • Last Modified:

what is an entity tag? (HTTP_QUERY_ETAG)

hello experts, i am using HttpQueryInfo to return some info about a remote file... and i came accross this

"HTTP_QUERY_ETAG
54
Retrieves the entity tag for the associated entity."

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wininet/wininet/query_info_flags.asp

it returns a string like this... "1e806a-2e-418fe05c"
my question is what is an entity tag?  what is it used for?
0
RobK6364
Asked:
RobK6364
1 Solution
 
RichieHindleCommented:
It's a server-generated identifier for the resource you ask for, at the time you ask for it.  It's used by caches to determine whether they need to re-read the resource, or whether it's unchanged from last time.

The first time a client asks for a resource, it is given that resource and an ETag.  The next time it needs it, it sends a request that says "Give me this resource, unless it hasn't changed since you gave me this ETag."  The server then responds with either "No, it hasn't changed" or "It's changed, so here's the new version."

A simple example of an ETag is one that's derived from the last-modified time of a file (there are HTTP header to do this specifically, but ETags are a more generic mechanism).  Another example would be a resource that depends on the state of a database - the ETag is updated whenever the database changes, so if someone asks for the same resource twice without an intervening change to the database, the second query won't go to the database at all but will be retrieved from the cache.
0
 
RobK6364Author Commented:
ok, great explanation.  thanks.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now