atomic-server icon indicating copy to clipboard operation
atomic-server copied to clipboard

Cache invalidation policy / logic for external resources

Open joepio opened this issue 3 years ago • 3 comments

Atomic-Server caches external resources indefinitely, at the moment. This means that any Property or Class that exists somewhere else, may get out of date. That especially may become problematic when an Agent changes their public key.

There is no logic at the moment for invalidating these cached resources. Some approaches:

Store time-fetched, set some (ENV controlled) time limit

When using the resource, check if this prop isn't too old. If it is too old, re-fetch!

Have some /invalidate endpoint

Here users can manually invalidate resources.

joepio avatar May 02 '22 07:05 joepio

I recommend to use the PROV-O ontology for annotating this - e.g. https://www.w3.org/ns/prov#generatedAtTime and https://www.w3.org/ns/prov#invalidatedAtTime

jonassmedegaard avatar May 08 '22 15:05 jonassmedegaard

Perhaps it even makes sense to view caching/mirroring of external data as a form of publication - either internal-only or a re-publication for external access as well. And as such it might make sense to annotate as a nanopublication.

jonassmedegaard avatar May 08 '22 16:05 jonassmedegaard

For managing resources potentially needing refreshing/expulsion, maybe sensible to embrace the Webmention protocol - implemented as a rust crate.

jonassmedegaard avatar May 08 '22 16:05 jonassmedegaard