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

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?
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
RobK6364Author Commented:
ok, great explanation.  thanks.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.