Implement cache for wfs_api()
Closed this issue · 3 comments
jlehtoma commented
Rudimentary implementation for getting data over WFS already exists in function wfs()
. This function also needs a cache, I suggest using the R.cache package
. Cached entities are the GML objects returned from the WFS. Decision need to be done regarding cache policies such as expiration time, flushing mechanism etc.
jlehtoma commented
I'm not too familiar with caching best practices, but here's what I had in mind:
- Caching is opt-in, i.e the default is
get_wfs_layer([...], cache = FALSE)
- Cache does not expire, i.e. it's up to the user to refresh the cache if needed.
- User will always be notified (
message()
) of all caching operations (i.e. saving and loading).
2 and 3 are pretty straightforward, but I'm more ambivalent about 1. It could equally well be argued, that caching should be enabled by default.
antagomir commented
Sounds good to me.
jlehtoma commented
New implementation of wfs_api()
is using httpcache
, which implements a rudimentary cachde.