Cache invalidation policy / logic for external resources
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.
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
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.
For managing resources potentially needing refreshing/expulsion, maybe sensible to embrace the Webmention protocol - implemented as a rust crate.