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.
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
Ensured that the BlobStore directory has correct permissions and is configured in GeoWebCache as the default.
Verified that tile caching is enabled for the layer in GeoServer.
Configured and ran a seeding job, which completes successfully but does not save any tiles to the BlobStore.
Checked that geowebcache.xml reflects the correct BlobStore configuration and gridsets.
Questions
What could prevent GeoWebCache from writing tiles to the BlobStore, even though tiles are generated dynamically via TMS?
Are there additional configurations or steps needed to enable caching for a custom gridset?
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:
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.
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.
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?
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.
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
Made sure “Enable direct integration with GeoServer WMS” is marked in caching defaults.
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?
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?
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.
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?