How do you make an etag that matches Apache?

后端 未结 4 1276
自闭症患者
自闭症患者 2021-02-04 10:13

I want to make an etag that matches what Apache produces. How does apache create it\'s etags?

4条回答
  •  不思量自难忘°
    2021-02-04 10:43

    If you're dynamically generating your page though, this probably won't make sense. If you're in PHP, you can pick the inode and file size of the main script, but the modify time won't tell you if your data has changed. Unless you have a good caching process or just generate static pages, etags aren't helpful. If you do have a good caching process, the inode and file size are probably irrelevant.

    Edit: For people who don't know what etags are - they're just supposed to be a value that changes when the content has changed, for caching purposes. The browser gets the etag from the web server, compares it to the etag for its cached copy and then fetches the whole page if the etag has changed.

提交回复
热议问题