what is an entity tag? (HTTP_QUERY_ETAG)

Posted on 2004-11-08
Last Modified: 2008-02-20
hello experts, i am using HttpQueryInfo to return some info about a remote file... and i came accross this

Retrieves the entity tag for the associated entity."

it returns a string like this... "1e806a-2e-418fe05c"
my question is what is an entity tag?  what is it used for?
Question by:RobK6364
    LVL 14

    Accepted Solution

    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.
    LVL 1

    Author Comment

    ok, great explanation.  thanks.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Better Security Awareness With Threat Intelligence

    See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

      Included as part of the C++ Standard Template Library (STL) is a collection of generic containers. Each of these containers serves a different purpose and has different pros and cons. It is often difficult to decide which container to use and …
    Introduction This article is a continuation of the C/C++ Visual Studio Express debugger series. Part 1 provided a quick start guide in using the debugger. Part 2 focused on additional topics in breakpoints. As your assignments become a little more …
    The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
    The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now