7

This question is directly a result of a question posted earlier about the units of cache size:

QGIS - what is cache size measured in

I went to the Options menu in QGIS, to the Network tab. Here is a screenshot of said tab.

QGIS Network options page

As you can see, my cache directory path is set to C:/Users/Russell/.qgis/cache/.

I went to look at the directory to see how large the directory was or the total size of the files contained within. To my surprise, the cache directory does not exist. I have my folder options set to show any hidden files and folders, so it is not simply hidden from my view.

QGIS Cache Directory Location

I've been using QGIS for a number of years now with no problems, and it does not seem slow. This leads me to believe it is being cached in another location.

The computer is running Windows 7. I installed QGIS using the OSGeo4W installer. Is there a setting somewhere that overrides the QGIS setting?

It seems worth putting this out there to see if there are other cases of this happening, or if it is isolated to my machine. As I said, I am not seeing an impact on performance, but that could simply be because the computer is speedy enough. It would be nice to know why the files for my installation don't seem to match what is shown in the program itself.

Any insight would be appreciated.

Thanks!

3
  • The cache is mainly used for WMS-C/WMTS. Are you using any of those?
    – jef
    Commented Apr 28, 2013 at 15:18
  • @jef - I am not using those. Does the cache directory only get created when and if I load in a WMS-C/WMTS? If that is the main, but not only use, shouldn't the cache directory still be created for other uses? Commented Apr 29, 2013 at 22:47
  • Nope. That particular 'cache' directory is just for WMS-C/WMTS tiles. It has nothing to do with the vector rendering cache or other caches. trac.osgeo.org/qgis/ticket/3357
    – R.K.
    Commented May 2, 2013 at 8:42

2 Answers 2

6
+50

The cache directory at C:/Users/Russell/.qgis/cache/ is actually the WMS-C/WMTS cache as @jef has mentioned. That's why it's in the Network tab of the Options dialog along with the WMS search address and proxy settings.

The naming is unfortunate but it has nothing to do with the render caching which is used to speed up redraws and other common operations. And to answer the original question, no, it seems to be created only when you use WMS-C and WMTS. Didn't exist by default in my .qgis folder either. It only got created when I started loading some WMS layers.

6
  • Thanks for the answer. It definitely seems like this could be documented better to indicate the on-demand creation, and the fact it isn't a location for render caches. Commented May 5, 2013 at 7:31
  • Yeah. I think it would it help if they'd change the name, too.
    – R.K.
    Commented May 5, 2013 at 7:38
  • 1
    Why care, when it's created? It's created when it's needed.And it's on the network page, the other settings are not named "network something" either.
    – jef
    Commented May 5, 2013 at 9:15
  • Ah, I meant the name of the folder. That way people would know what kind of cache it is.
    – R.K.
    Commented May 5, 2013 at 10:49
  • @jef - Why care when it is created because some people look at those settings, and go find them on their file system. If they can't find them, they think that something is wrong. Just because a problem hasn't cropped up, does not mean there is no problem. As to it being on the "Network Page", well it wouldn't be the first time that something located on one page applied to multiple settings. Since there is a "Rendering" cache setting, but no location, it would be easy to assume that cache is in the "Network" cache location as well. Commented May 6, 2013 at 9:09
4

As said the cache is only use for network accesses - probably most useful for tiles in WMS-C and WMTS, but also use for the capabilities of WMS, WCS, WFS and for SVGs in case they aren't local. It's created on demand - ie. only when a network reply should be save for later reuse.

2
  • So this means QGIS does not cache Postgis Layer in any way? This would explain some performance issues I often have. Commented Sep 2, 2016 at 14:28
  • That is correct. Commented Feb 16, 2023 at 12:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.