if-modified-since vs if-none-match

前端 未结 7 1875
别跟我提以往
别跟我提以往 2020-12-04 05:32

What could be the difference between if-modified-since and if-none-match? I have a feeling that if-none-match is used for files whereas if-modified-since is used for pages?<

7条回答
  •  孤街浪徒
    2020-12-04 06:10

    If-Modified-Since is compared to the Last-Modified whereas If-None-Match is compared to ETag. Both Modified-Since and ETag can be used to identify a specific variant of a resource.

    But the comparison of If-Modified-Since to Last-Modified gives you the information whether the cached variant is older or newer whereas the comparison of If-None-Match to ETag just gives you the information whether both are identical or not. Furthermore do most of the ETag generators include the information of the system specific inode so moving a file to a different drive may change the ETag as well.

提交回复
热议问题