-
Type: User story
-
Status: Resolved
-
Priority: Minor
-
Resolution: Won't Fix
-
Affects Version/s: None
-
Fix Version/s: QualifiedToSchedule
-
Component/s: API
A first implementation has been done here: JAVACLIENT-24.
Here is the all discussions around the cache layer for further purpose in the README cache layer part -> update it to fill the missing part.
Goals
If needed, for example on Android, we should be able to easily add caching logic.
How?
All caches should be accessible via a generated cache key defined by the request itself:
- headers
- base url
- endpoint used
- parameters
- body
- content type
- ...?
How many?
3 caches should be implemented:
- Raw Response Store : The server response is simply stored on the device so that it can be reused in case the server is unreachable OR to avoid too many frequent calls.
- Document Response Store: Store the unmarshalled response objects (here Documents) and updates.
- Document Transient Store bound with deferred calls queue: keeping changes of document.
- Deferred Calls Queue: The Create Update Delete operation will be stored locally and replayed when the server is available. Requests pure calls.
- Actions/Events
Pending questions: Invalidations
----> What would be a default timeout for each cache?
Potential rules offline:
- When listing documents, check the document transient store
- then check the document response store
- then check the server response
Synchronisation
- Should we apply those rules ?
- Should we use ETag And/Or If-Modified-Since with HEAD method ?
Potential Stores
Depending on client:
- "In memory" - guava for java
- "Database" - SQlite for Android
- Local storage for JS
- On disk for both
- Others?
Miscellaneous
- For the dirty properties of objects (like dirty properties of automation client for documents) - out of scope of caching