[gdal-dev] Understanding VSI caching

Even Rouault even.rouault at spatialys.com
Mon Apr 9 13:02:38 PDT 2018


On lundi 9 avril 2018 21:03:12 CEST Andrea Aime wrote:
> On Mon, Apr 9, 2018 at 8:58 PM, Even Rouault <even.rouault at spatialys.com>
> 
> wrote:
> > Which disk caching are you refering too ? There's some disk caching for
> > the
> > WMS driver, but that's all
> 
> "In addition, a global least-recently-used cache of 16 MB shared among all
> downloaded content is enabled by default, and content in it may be reused
> after a file handle has been closed and reopen. Starting with GDAL 2.3, the
> size of this global LRU cache can be modified by setting the configuration
> option CPL_VSIL_CURL_CACHE_SIZE (in bytes)."

Ah, it probably means a precision "during the life-time of the process or 
until VSICurlClearCache() is called" (just added). It's just a RAM cache.

> 
> and I see in the code:
> 
> https://github.com/OSGeo/gdal/blob/master/gdal/port/cpl_vsil_curl.cpp#L203
> 
> (btw, there is no path, does it mean the file is created in the current
> directory?)

Yes, that was the more or less dead code I was mentionning too. Actually it is 
compiled in, and can be enabled with CPL_VSIL_CURL_USE_CACHE=YES, but it is 
very likely broken, unfit for any reasonable purpose etc. No warranty. Consult 
your lawyer, be sure you have a fallout shelter ready, etc ;-)

Even

-- 
Spatialys - Geospatial professional services
http://www.spatialys.com


More information about the gdal-dev mailing list