We have the following requirements for locally caching IEV requests:
Create, as with relaton, a local and a global cache. These will be distinct from the relaton caches, and filenames will be supplied from the IEV invocation, as with relaton.
Store all instances of phrases retrieved by IEV in both the local and the global cache. The term is all that needs to be stored at this stage, but it is possible in future iterations we may store the definitions as well; so allow for this by storing a struct of {term: ..., definition: nil}
As with relaton, look up the requested IEV code and language in the local and global cache, before requesting the instance from the live IEV site.
The key for the entry shall be the IEV code + the language requested; e.g. "IEV 101-01-01/en".
Use the same rules of precedence for local and global cache retrieval as in relaton: the local overrides the global if they both have a value for a key.
Unlike Relaton, there is no notion of entries becoming stale; so at least at this stage, there is no need to store the date of last access in the caches.
Migrated from https://github.com/riboseinc/relaton/issues/9
We have the following requirements for locally caching IEV requests:
{term: ..., definition: nil}