How I can use the HTTP headers to indicate in the Response that possibility?

Posted by Cris Hong Kong CRISHK on Stack Overflow See other posts from Stack Overflow or by Cris Hong Kong CRISHK
Published on 2012-10-18T03:51:57Z Indexed on 2012/10/18 5:03 UTC
Read the original article Hit count: 250

Filed under:
|
|

Finally I accomplished to cache dynamic images, css, and javascript files using HTTP headers BUT I have a problem now:

I have specific dynamic images that are equal but has different URL's.

For example:

  1. http://example.com/image/src/the-same-image.jpg

  2. http://example.com/image/custom/src/the-same-image2.jpg

1 and 2 has the same file content but different URL. This is a problem now because the navigator assumes that the file are different and need to be cached (due to the URL), when the real cached file is only one.

I have the possibility to know if the file at the URL's are the same.

How I can use the headers to indicate in the Response that possibility, and the navigator will cache only one file?

© Stack Overflow or respective owner

Related posts about http

Related posts about caching