I am applying etag
for all the responses but want to know whether to apply etag for the responses with status 4xx or 5xx
Asked
Active
Viewed 122 times
-2

gursharan singh
- 47
- 1
- 6
-
Why do you want to apply the `ETag` to client or server error pages? The client/browser is not requesting error pages. – Progman Apr 05 '21 at 11:15
1 Answers
2
The specification describes When to Use Entity-Tags and Last-Modified Dates:
In 200 (OK) responses to GET or HEAD, an origin server SHOULD send an entity-tag validator...
So, no, there is no reason to send ETags
for 4xx or 5xx responses. Those codes indicate that a valid response could not be generated; therefore, there is no representation that the ETag
could meaningfully apply to.

Community
- 1
- 1

Kevin Christopher Henry
- 46,175
- 7
- 116
- 102