aboutsummaryrefslogtreecommitdiff
path: root/src/open_lib.cpp
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2019-12-31 00:00:41 +0100
committerEven Rouault <even.rouault@spatialys.com>2019-12-31 19:07:38 +0100
commitdb040122c566442500e3ea0d7928d32ac3a3ed29 (patch)
tree3e120457cc63b28e487e0cadf7465d71e4af83d4 /src/open_lib.cpp
parentea73297ea426eac1dcc0133c4cd730ff029e26a8 (diff)
downloadPROJ-db040122c566442500e3ea0d7928d32ac3a3ed29.tar.gz
PROJ-db040122c566442500e3ea0d7928d32ac3a3ed29.zip
Add a SQLite3 local cache of downloaded chunks
Diffstat (limited to 'src/open_lib.cpp')
-rw-r--r--src/open_lib.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/open_lib.cpp b/src/open_lib.cpp
index cde5be7b..23ee79a0 100644
--- a/src/open_lib.cpp
+++ b/src/open_lib.cpp
@@ -520,6 +520,16 @@ void pj_load_ini(projCtx ctx)
ci_equal(value, "YES") ||
ci_equal(value, "TRUE");
}
+ } else if ( key == "cache_enabled" ) {
+ ctx->gridChunkCache.enabled = ci_equal(value, "ON") ||
+ ci_equal(value, "YES") ||
+ ci_equal(value, "TRUE");
+ } else if ( key == "cache_size_MB" ) {
+ const int val = atoi(value.c_str());
+ ctx->gridChunkCache.max_size = val > 0 ?
+ static_cast<long long>(val) * 1024 * 1024 : -1;
+ } else if ( key == "cache_ttl_sec" ) {
+ ctx->gridChunkCache.ttl = atoi(value.c_str());
}
}