That’s entirely up to the application to generate it as it wants. It can be created and updated manually or can be auto-generated. Common methods of its auto-generation include using a hash of the resource’s content or just a hash of the last modification timestamp. The generated hash should be collision-free.
Validation of ETag value
It is just comparison of two values. It is divided into 2 parts
- Strong Validation
- Weak Validation
1.Strong Validation:
The different resource representations are byte-for-byte identical. This is the default validation of ETag and no special directive is used for it.
2.Weak Validation:
The two resource representations are semantically equivalent. For e.g. the current date displayed on the page might not be important for updating the entire resource for it.