Skip to content

Entity caching #43

@zverok

Description

@zverok

First take: eternal cache with manual cleanup.

  1. Cache is opt-in (should be explicitly turned on through config or Reality.cache!)
  2. Cache path should be configured (with reasonable default somewhere in /tmp?..)
  3. Each entity is cached by name, in two separate file: wikipedia data & wikidata data (we cache source, not parsed entity, because after adding new parsers richer data can be extracted from same cached source; drawback is parsing speed)
  4. There should be way to query if entity is from cache or from the wild (or, alternatively, how old is it)
  5. Dictionaries (lists) caching.

In future, we should consider:

  • TTL settins (even per-entity);
  • Explicity refreshing entity or invalidating cache;
  • Methods, if possible, for meta-query Wikipedia/Wikidata "if the page changed" (for cached pages), and load them only in this case.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions