Can not get geowebcache to work - no tiles are saved to BlobStores

I am new to geoserver. I have spent a couple of days this week to try to start a server up. I think I get the basics to work. I have data in postgis - create connections to my geoserver, worked with styles etc.

I can connect to my published layers in different ways, qgis via wms, leaflet via wms etc.

But I really need to get the caching function to work to make my geoserver fast enough. And I can not get it to work. and I can not understand what I am doing wrong, and I’m hoping someone here can help.

Environment Details

  • GeoServer Version: 2.26.1
  • Java Version: OpenJDK 17
  • OS: Ubuntu 24.04
  • GeoWebCache BlobStore Directory: /opt/geoserver/data_dir/gwc
  • Custom GridSet: EPSG:3006_custom (details below).

What I’m Trying to Achieve

I want to enable tile caching for a WMS layer (gk:textpunkt) using a custom gridset (EPSG:3006_custom). The layer works correctly in GeoServer WMS previews, and the custom gridset has been successfully created and linked to the layer.

What’s Working

  • The layer (gk:textpunkt) is accessible via WMS and renders correctly.
  • The custom gridset (EPSG:3006_custom) is functional and linked to the layer.
  • I can retrieve tiles through TMS links (e.g., http://my-server:8080/geoserver/gwc/service/tms/...), and tiles are rendered dynamically.

What’s Not Working

  • Tiles are not being saved to the BlobStore directory.
  • I have set up the BlobStore with read/write permissions for the GeoServer user, and it is defined as the default in geowebcache.xml.
  • Running a seeding job completes successfully, but no tiles are stored in the BlobStore. No new directories or files appear in the BlobStore path.
  • The GeoWebCache log does not show any errors during seeding or tile access.

Steps I’ve Tried

  1. Ensured that the BlobStore directory has correct permissions and is configured in GeoWebCache as the default.
  2. Verified that tile caching is enabled for the layer in GeoServer.
  3. Configured and ran a seeding job, which completes successfully but does not save any tiles to the BlobStore.
  4. Checked that geowebcache.xml reflects the correct BlobStore configuration and gridsets.

Questions

  1. What could prevent GeoWebCache from writing tiles to the BlobStore, even though tiles are generated dynamically via TMS?
  2. Are there additional configurations or steps needed to enable caching for a custom gridset?
  3. How can I better debug why tiles are not being written to the BlobStore?

Additional Details

If it helps - here’s the gridset configuration for EPSG:3006_custom:

<gridSet>
  <name>EPSG:3006_custom</name>
  <description>Custom gridset for EPSG:3006</description>
  <srs>
    <number>3006</number>
  </srs>
  <extent>
    <coords>
      <double>255000.0</double>
      <double>6130000.0</double>
      <double>925000.0</double>
      <double>7680000.0</double>
    </coords>
  </extent>
  <resolutions>
    <double>16384.0</double>
    <double>8192.0</double>
    <double>4096.0</double>
    <double>2048.0</double>
    <double>1024.0</double>
    <double>512.0</double>
    <double>256.0</double>
    <double>128.0</double>
    <double>64.0</double>
    <double>32.0</double>
    <double>16.0</double>
    <double>8.0</double>
    <double>4.0</double>
    <double>2.0</double>
    <double>1.0</double>
  </resolutions>
  <tileHeight>256</tileHeight>
  <tileWidth>256</tileWidth>
</gridSet>

Any advice or suggestions would be greatly appreciated. Thank you in advance for your help!

Best regards,
Stefan

Hello,

By default GeoWebCache use the default blobstore which is not persisted on disk.

On the Layer page, please check in the Tile Caching tab which BlobStore is selected. If you want to be sure of the destination of the created tiles, I advise you to create explicitely a File BlobStore and configure your layer to use it.

Regards
Alexandre

Thanks Alex,
Perhaps I missed that in the desicription. I have created a new Blobstore, specified what folder it should be and made sure the geoserver user has rights to that folder.

What is surprising me is that I do not see any folders or tiles create in that folder. Regardless if I start a seeding job or if I access the layer from other tools. My expectation was that it would save cached tiles in that file structure when I load them. And in the end my hope was to seed the top most part of the pyramid - in the most zoomed out parts of my map service, and then dynamically create more tiles along the way when someone access these tiles.

Hi Stefan

Welcome to the GeoServer users group, where I hope we can solve your problem.

Firstly, thanks for an exemplary report, where you say what you have tried already!

  1. Have you associated the tiled layer with a blobstore in the Tile Caching tab?

  1. What are the HTTP response headers for your TMS request showing?

Regards

Peter

  1. Also, check first, does it work with a standard gridset e.g. 4326, to eliminate the custom gridset being the source of your problems.

  2. Try a WMTS (or WMS, tiled=true) request instead of your TMS request.

Thank you for you ideas and help. I like the good respons my first post in here has gotten. Thank you for helping me out.

I do not know what step in the process that made things work but now I do see cached tiles being stored on my server. And when I live move around and go to a new zoom-level I can see them populate. So both seeding and using the tms-access works. Great!

It almost feels like Mr Murphy taking a break and all of a sudden it worked. (where it is more likely that one of your advices made the difference).

If I may ask a follow up question - as I said I can make it work now when I call it with TMS. But TMS is difficult for me to use with e.g. my leaflet maps. On the other hand, when I use WMS in my leaflet pages it works seemeles in terms of aligning layers. But from a performance perspective it does not seem to use the cache. And I can not see new tiles being produced either. So my conclusion is that WMS caching does not work for me.

I see in the Caching Defaults page that “Enable direct integration with GeoServer WMS” is turned on, as well as “WMS-C Service”.

Am I right in assuming caching would also work for WMS? If so - are there any standard pitfalls you might fall into?

Hi Stefan

Use tiled=true in your WMS request.

Have you read Using GeoWebCache — GeoServer 2.27.x User Manual - that might give you some more info.

Regards

Peter

Hi,
yes, I tried tiled=true as well.

I think I have to redo the set up for my server and try again. I did read the manual page but obviously there is something I have missed. It might also have been a poor server that I used that caused some issues. Note to self (and others) never use Contabo again for VPS-services. They are simply not trustable.

As long as I know that using geowebcache via wms is doable, then I will spend time making it work. If it is not and only via TMS, I will have to think about how to solve it, like exploring if setting top left origin is possible at all in geoserver - as this is what I have in my base maps tile sets that are already generated in another tool.

Again, thanks for the help and warm welcome.

Hi again,
I have today tried to work on a local installation of geoserver to see if I get this to function - and understand what I am doing wrong.

My ideal situation would be to use wms with cache, because I simply know how to get wms layers to work well with my leaflet based map.

Creating tiles by seeding is working. With the help earlier I got that set up. I can seed, and also when I use TMS to call for tiles in zoom layers that are not seeded, new tiles are saved to the cache. So this seems like working well.

Now, for WMS. I can not make this work.

I have

  1. Made sure “Enable direct integration with GeoServer WMS” is marked in caching defaults.
  2. The call for a tile is with tiled=true. This is an example URL: http://localhost:8080/geoserver/Postgis/wms?tiled=true&service=WMS&request=GetMap&layers=textpunkt&styles=&format=image%2Fpng&transparent=true&version=1.1.1&width=256&height=256&srs=EPSG%3A3006&bbox=315047.9995332599,6404352.000003238,315175.9995356138,6404480.000003283
    This fetches an image tile - but it does not save to the cache folders. I see on the disk that no new zoom levels / folders / files are created when using.

I have added into geowebcache.xml the line
true
which I saw as one advice.

I’ve added a normal grid set (EPSG:4326) - both to the layer and to the cache default settings - no new grid set folder is created when retrieving a tile.

I have read the manual page four times. I can not understand what I am doing wrong.

Can anyone confirm that they do get geowebcache to work for WMS?

Hi Stefan

See my point 2 above. What are the HTTP response headers for your WMS request? Use the browser DevTools (F12 or Ctrl-Shift-I) to view them.

You should see Geowebcache-xxxx headers, with the Cache-Result one being particularly useful. See screenshot above.

Your request above is for EPSG:3006 - does that grid set exist as a tiled option? Can you rather try to get it to work with a standard projection e.g. 4326?

To answer your question: yes, it definitely does work - this is fairly basic functionality.

Peter

I think the question is a bit odd - GeoWebCache does provide a WMS endpoint… but it should not really be used.

Consider that WMS-C (for Caching) is a convention defined on a wiki in response to google maps. For the WMS to work the client has to know the convention, read the tiles description, and produce WMS requests that are following the formula to “align” with the tileset.

So I ask - what client are you using to make the request?

Now that real tile protocols are available, TMS and WMTS, they should be preferred.

If you go to the embedded geowebcache:

http://localhost:8080/geoserver/gwc/

You can see three services:

And it has the note:

Note that the latter will only work with clients that are WMS-C capable.
Omitting tiled=true from the URL will omit the TileSet elements.

This is an example of the open source community doing something while waiting for the standardization process. The standardization process is now complete and WMTS is available - please use that one.

If you use the WMS link above in a normal client the result will not be cached, it has to be “WMS-C capable” and follow the instructions on WMS Tiling Client Recommendation - OSGeo

Can you try again using a tiling protocol, or confirm that your client knows about WMS-C Tileset description?