Understand the weak comparison function

471 views Asked by At

HTTP 1.1 defines a weak comparison function for cache validators:

in order to be considered equal, both validators MUST be identical in every way, but either or both of them MAY be tagged as "weak" without affecting the result.

I understand that following statement (for two ETags) is true:

W/"Foo" = "Foo"

Now I'm wondering what real world use case might exist where a server compares a weak ETag against a strong one.

1

There are 1 answers

0
Julian Reschke On BEST ANSWER

There are cases where servers first assign a weak etag, and later on promote it to a strong etag (by removing the "W/" prefix). An example is Apache moddav (or is it plain httpd?), when configured to create entity tags based on the filesystem timestamp of the file being served.