You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note: This generated ETag is a random UUID. When you repeat the PUT (with same URL and same body", a new UUID is generated - so the ETag is not a body hash or so.
When you later GET this resource, the ETag is reported as http-Header:
When you PUT a new resource, then you can hand over an ETag as http request header, avoiding the generation of a random UUID - with the header "if-none-match". Example:
I think the request header "if-none-match" should never influence the ETag value. Either we should completly disable the option to give an explicit ETag value on PUT or we use "ETag" as request header to give the ETag value (and not "if-none-match") - although "ETag" is only specified to be a response-header.
Weird 2
generated ETag value should better be a hash of the content than a random UUID. This makes the ETag stronger, leading to a constant ETag value if a resource with same body is PUT multiple times.
Weird 3
There is no "if-match" handling - but this would be valuable especially for PUT requests.
We could youe it for optimistic locking for resources, able to find modified resources by some other clients before we PUT a changed version of a resource.
The text was updated successfully, but these errors were encountered:
Preface
vertx-rest-storage generates an ETag value when you PUT a resource to Redis. Example:
then you find in Redis:
Note: This generated ETag is a random UUID. When you repeat the PUT (with same URL and same body", a new UUID is generated - so the ETag is not a body hash or so.
When you later GET this resource, the ETag is reported as http-Header:
When you get with request header 'if-none-match', then rest-storage optimizes the response as "304 not modified":
so far, so good
Weird 1
When you PUT a new resource, then you can hand over an ETag as http request header, avoiding the generation of a random UUID - with the header "if-none-match". Example:
I think the request header "if-none-match" should never influence the ETag value. Either we should completly disable the option to give an explicit ETag value on PUT or we use "ETag" as request header to give the ETag value (and not "if-none-match") - although "ETag" is only specified to be a response-header.
Weird 2
generated ETag value should better be a hash of the content than a random UUID. This makes the ETag stronger, leading to a constant ETag value if a resource with same body is PUT multiple times.
Weird 3
There is no "if-match" handling - but this would be valuable especially for PUT requests.
We could youe it for optimistic locking for resources, able to find modified resources by some other clients before we PUT a changed version of a resource.
The text was updated successfully, but these errors were encountered: