Locally caching remote or inline resources via "cache" key
See original GitHub issueAs of 1.0.0-beta.15
, only one of path
, url
, or data
is allowed on a given resource. In discussing this, it was suggested that it is useful to have a local path to which to download a remote (url
) or inline (data
) resource so that non-datapackage-aware tooling can access. As a result of discussion in #223, it has been suggested that a new key, cache
, be used on a resource to specify a local path to “cache” remote or inline resources to disk.
Examples:
{
"url": "http://xyz.com/dataset.csv",
"cache": "dataset.csv"
}
{
"data": [
{"a": "1", "b": "2"}
],
"cache": "dataset.csv"
}
So, when a resource has a url
or data
key, it SHOULD
also have a cache
key. An implementation that is reading the data in the data package, should then first check cache
for the data, if it exists, and, if not, save the data as specified in url
or data
to cache
. Otherwise, cache
acts just like path
. When a resource has a path
key, an implementation should ignore cache
.
WDYT? @morty @amercader @rgrp @pwalsh
Issue Analytics
- State:
- Created 8 years ago
- Comments:25 (21 by maintainers)
Top GitHub Comments
Removing from v1 milestone as now a pattern item.
This was done in #331 and will close when it is merged.