Design a solution for caching downloads of $refs
in order to improve performance in cases with many remote refs
#452
Labels
enhancement
New feature or request
Original use-case sourced from this PR: #451
The current caching capability significantly improves runtimes for remote schemas when there is a single remote file to download, but does nothing to improve the case where there are refs to resolve. Refs are cached in-memory by
referencing
, but discarded between runs.For faster runs,
check-jsonschema
should cache resolved refs on disk as well.Some basic requirements:
--no-cache
settingNote
A friend of mine suggested putting cache data into a DB (e.g. sqlite) when we talked about this, so that it could be annotated with richer metadata and structure. Although that might be a good idea longer term, I don't want to reach for that quite yet -- I think this can be solved with a good dir structure for now.
Here's one initial idea, for evaluation:
{md5 of the absolute URI}.json
~/.cache/check_jsonschema/
dir, add a dir namedrefs/
(the schemas are in a dir nameddownloads/
, which now seems like a suboptimal name but will suffice)refs/
dirThe text was updated successfully, but these errors were encountered: