1

It would be great to get an advice on this topic as its something it troubles me regularly in different projects.

I always find it hard to work efficiently with geoserver and geowebcache when it comes to cached layers etc.

I use a stack of technologies, which are difficult to change (in the current project). I know that my geoserver is quite old (2.5).

I also use geoserver api and gsconfig to create new layers, update the bounding box of a layer etc. I also use a set of POST requests (with python) to add new features on my point/polygon and line layers.

It works but not always. Although I send a seed request to make sure that I update my layer based on the new data:

<seedRequest>
 <name>workspace:layer_name.xml</name>
  <srs>
   <number>4326</number>
  </srs>
  <zoomStart>1</zoomStart>
  <zoomStop>20</zoomStop>
  <format>image/png</format>
  <type>truncate</type>
 <threadCount>2</threadCount>
</seedRequest>

I don't always get to see what it actually exists on the layer and is visible through the layer preview functionality of geoserver. Most of the time if I zoom in/out the features appear (in some random zoom level).

I understand that something goes wrong with the seeding process. Tiles are not seeded correctly/ Old features, which were moved or don't exist keep popping up in different zoom levels.

I also suspect that this might be the browser's cache. Of course I cannot ask from the users to hard reset their browser.

Are there specific strategies to follow here? To bypass the cached file etc?


Settings in geoserver

enter image description here

EDIT

Checking the HTTP headers in developers tool I see that my geowebcache-cache-result equals to MISS. There must be something wrong with the WMS request.

This is my RequestURL:

http://geonode.wfp.org/geoserver/wms?SERVICE=WMS&LAYERS=geonode%3Awld_wfp_ipc_phases&FORMAT=image%2Fpng&TRANSPARENT=TRUE&VERSION=1.1.1&REQUEST=GetMap&STYLES=&TILED=true&SRS=EPSG%3A900913&BBOX=-5009377.085,-10018754.17,0,-5009377.085&WIDTH=256&HEIGHT=256

enter image description here

EDIT II

The above image displays the Response Headers for the request of a specific layer. I see now that in other layers there is no issue the geowebcache-cache-result parameter (it equals to HIT).

enter image description here

But if I understand correctly the issue is that while geowebcache in this case works, sometimes it returns outdated tiles. Does someone can understand something more from the above screenshot?

2

Do you have HTTP caching headers setup for that layer? If so, the browser won't even ask and use its locally cached file. See http://docs.geoserver.org/stable/en/user/geowebcache/responseheaders.html

Also check inside the layer publishing section for the cache headers:

enter image description here

With the above settings the GWC response will contain:

Date:Mon, 05 Sep 2016 14:26:37 GMT
Expires:Mon, 05 Sep 2016 15:26:38 GMT

which implies the browser won't ask for the same tile until the expiry time is reached

  • Response cache headers is not selected for any of my layers. So I guess this is not the reason. – user1919 Sep 5 '16 at 14:48
  • Though in the Tile caching tab the option: Create a cached layer for this layer is selected (as shown in the screenshot). – user1919 Sep 5 '16 at 14:52
  • 1
    You should check the actual HTTP headers found in the tile requests (you can use common browsers developer tools, then the network panel, to inspect them). Also, another possible hypothesis, are you browsing the data while the truncate process is still ongoing? Depending on the area truncating 20 zoom levels can take only a few seconds, minutes, hours or several days. – Andrea Aime Sep 6 '16 at 7:14
  • I have checked the HTTP headers. There is definetely something weird cause my geowebcache-cache-result equals to MISS. I think in any case it should be HIT, right? Apart from this maybe you are right. I might try to display the data before the truncating request has finished. But the same is the same even for very small layers with a couple of points. Can you please advice what can be wrong with the geowebcache MISS parameter? – user1919 Sep 6 '16 at 10:22
  • You get HIT when the tile was already in the case, MISS if it was computed upon request because it was not in the cache already. If you get a HIT while truncating the cache, it's likely you're getting an old tile that is yet to be deleted by the truncation process – Andrea Aime Sep 7 '16 at 8:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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