When I looked at Flask(werkzeug) source codes around etag, I found that it generates a response object, generates etag from the data by sha1, compares it with the if-none-match etag of the request, and returns 304 or 200. So the process of accessing the DB and creating a response is the same regardless of whether there is an etag or not, and the benefit of an etag is just not having to send data to the client.
Of course, if you have a large amount of data, there are advantages, but if the data is not that large, is it considered to be of little use?
Instead of re-creating the etag from the response for each request, I thought it would be better to store the etag in redis or the server memory, etc., when there is a change in the object that is the target of the request, and compare it with the pre-stored etag when the request is made.
Is this way of caching not often used?