0

I have this etag header from the web server,

ETag | 1347613725000

This is a png image, but I have no idea on how to check if the file is expired.

Right now I'm hashing the stream with this code:

MD5CryptoServiceProvider md5 = new MD5CryptoServiceProvider();
byte[] hash = md5.ComputeHash(value);
result = BitConverter.ToString(hash).Replace("-", string.Empty).ToLower();

But the result of this code is: e0d9ddc1c72ade0a1924dddf68c8c12e

Thanks.

2 Answers2

1

You can't check that; only the server can (the Etag is simply an opaque string).

Julian Reschke
  • 40,156
  • 8
  • 95
  • 98
1

If you send a HTTP-request to the server and the image with the etag in a If-Match header you should get a 304 Not Modified back if the png hasn't updated. If it has updated you should get a 200 OK.

Smetad Anarkist
  • 898
  • 9
  • 19