In my previous article about on-device data caching with HTTP request header values, I alluded to a more complex, but more powerful way to cache data from your REST calls on the client. This, too, provides a free, zero-code caching solution, and again requires your REST API to provide specific HTTP response headers. This technique involves using the HTTP response header named " ETag ". While the format of the value isn't specified in the standard, it's generally thought of as an large-ish integer that represents a hash of the REST response payload (or something similar). The Server Rules (again) As with the Cache-Control header, the server is responsible for sending the ETag value to the client. The basic idea of the ETag is for the client to ask the API server "do you have newer data than I do?" In order to communicate the idea of "newer", the server sends a value is that it is a hash (or something else) unique to this particular pay...
DiveInto Mobile
Mobile App Development Lessons Learned