wtsi-hgi / hgi-web_usermod

User roles authentication module for HGI-web
Other
0 stars 0 forks source link

Set HTTP ETag header and check If-Match, and If-None-Match headers #3

Open jrandall opened 11 years ago

jrandall commented 11 years ago

Each resource should have an ETag (http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.19) set that the usermod service would ideally be able to calculate quickly. Client user agents will remember the ETag associated with data in the local cache, and after local cache expiration rather than doing a full new GET request will issue a GET with "If-None-Match" set (http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.26), such that it expects a full response only if the ETag doesn't match (otherwise 304 Not Modified).

The client could also guard PUT requests by adding the "If-Match" (http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.24) header to only do the update if the server and client versions agree.