Open peter-mueller opened 9 years ago
Version wird jetzt als Etag Header ausgegeben. Falls If-Match mitgesendet wird (wird es noch nicht von der gui) wird auch der oben gennante Fehler verhindert.
@FabianHoltkoetter @xdoo @darenegade Sollen diese Änderungen nun in die GUI eingebaut werden?
8.3. Architecting a more efficient frontend
ETags combined with the If-Match and If-None-Match headers empower you to build frontend that is more friendly to consumer’s data plans and mobile battery lives.
Identify the entities that need locking and add a version attribute. HTML5 nicely supports data-* attributes, so store it in the DOM somewhere like data-etag attribute.- Identify the entiries that would benefit from tracking most recent updates. When fetching these resources, store the Last-Modified in the DOM (data-last-modified perhaps).
When fetching resources, also embed self URIs into your DOM nodes (perhaps data-uri or data-self) so it’s very easy to go back to the resource.Adjust PUT/PATCH/DELETE operations to use If-Matchand also handle HTTP 412 Precondition Failed status codes.- Adjust GET operations to use If-None-Match, If-Modified-Since, and also handle HTTP 304 Not Modified status codes.
By embedding ETags and Last-Modified values into your DOM (or perhaps elsewhere for a native mobile app), you can then reduce the consumption of data/battery by NOT retrieving the same thing over and over. You can also avoid colliding with other clients, and instead, be alerted when you need to reconcile differences.
Sollte meiner Meinung nach auf jedenfall integriert werden. Zusätzlich muss die GUI auf die hiermit verbundenen HTTP-Messages reagieren können.
@peter-mueller wäre gut, wenn das gemacht würde. Evtl hast du ja schon? :)
Bei parallelem Arbeiten kann es passieren, dass zwischenzeitliche Änderungen überschrieben werden. Das sollte abgefangen oder zumindest erkannt werden.