[Geoserver-users] GeoServer Caching question

Christian,

Thank you for your pointers. As an aside, the semicolon (e.g. EPSG;4326) was a typo on my part and does not actually show up in code, etc.

So I’ve been doing some further experimentation and I guess I’m not seeing some expected behavior. I understand the rationale for the “Seed/Truncate” functionality. Basically, this enables you to pre-build a cache for all possible values before any user actually requests what would be placed in the cache the first time a tile was requested.

However, I decided to empty the cache to see how things would be cached on a request-by-request basis rather than seeding the cache ahead of time. Well, I’m not seeing it cache anything! I’ve issued WMS requests to my GeoServer instance (with “direct integration with GeoServer WMS” enabled, and tile caching and cache layers enabled for my layer) using various clients (e.g. WorldWind Java client, web-browser, curl, etc.). My expectation is that if I submit a GetMap request like this:

http://localhost:8080/geoserver/cite/wms?service=WMS&request=GetMap&version=1.1&srs=EPSG:4326&layers=bls_unemployment_by_state_sept_2012&styles=&transparent=TRUE&format=image/png&width=256&height=256&bbox=-144.0,18.0,-108.0,54.0&tiled=true

via the web browser, or curl, or NASA WorldWind client, that I would see at least one image show up in: C:\Program Files (x86)\GeoServer 2.2.2\data_dir\gwc\cite_bls_unemployment_by_state_sept_2012

I mean, I can see the tile pyramid built in this directory when I explicitly seed the layer. But why don’t I see things being cached on a per-request basis? Is it something with the client-side configuration (e.g. browser, curl, etc.) telling the server NOT to cache things?

Any maybe this is a problem using the GWC built into GeoServer. Is it generally recommended to stand up a separate GWC Standalone instance and have GeoServer reference that vice using the integrated option? Are there good instruction for setting up such an arrangement?

v/r

Ben

···

From: Watson, Ben
Sent: Thursday, January 03, 2013 11:07 AM
To: ‘geoserver-users@lists.sourceforge.net’
Subject: GeoServer Caching question

I’ve got some questions regarding GeoServer’s GWC capabilities. Perhaps if I describe my desired behavior first, what I’m attempting to implement will make more sense.

We would like to stand up an “application local” WMS to serve client-side applications specific to this particular program. The client side is coded using NASA’s WorldWind Java client. Therefore, the client-side applications will connect directly to the “application local” WMS server to fetch GIS data for visualization. I’ll call this particular server GeoServer A (or GSA).

I’d like to make use of the WMS Cascading capabilities in GeoServer to reach out to other external WMS servers to pull in their data. To demonstrate this point, I implemented a NASA WorldWind WMS on my computer (we’ll call this NWMS) serving up NASA Blue Marble Next Generation. I added new WMS Store to GSA, pointing it to the GetCapabilities URL of NWMS and it discovered the layers as expected. After publishing the layer, I was able to successfully point the WorldWind client to GSA rather than NWMS and it all worked as expected.

So now, I’ve created a virtual machine and installed another instance of GeoServer (we’ll call this GSB). Again, I created a new WMS data store on GSA pointing it to GSB and selected a rather trivial custom layer I added to GSB. And again, this all works as expected.

So now the caching. One of the things our program would like to be able to do is point to an external GIS data source and locally cache the data such that if we have network connectivity problems to the external source, the client applications can still access the data from the “application local” WMS (e.g. GSA in my case). To demonstrate this, on GSA, went to the “Caching Defaults” page and enabled “direct integration with GeoServer WMS”. I’ve also enabled tile caching on the layers I’m experimenting with on GSA. Again, these layers are from the remote WMS data stores. Under “Tile Layers”, I selected the “Seed/Truncate” link next to the layer and forced a “Re-seed” of the layer. I watched the command line interfaces for both GSA, GSB, and NWMS busily exchange information and confirmed on the file system that GSA is building these cache pyramids.

So now my thinking is, I should be able to turn off NWMS and GSB since GSA has locally cached the data. However, when I connect to GSA from my WorldWind client, I see errors in the command line corresponding to GSA saying it can’t connect to the remote servers. I thought all of this stuff was locally cached?

Furthermore, even with the backend servers (NWMS and GSB) up and running, when I use the curl tool, I see lines like the following for the custom GWC HTTP headers:

geowebcache-miss-reason: request does not align to grid(s) ‘EPSG;4326’ ‘My_EPSG:4326’

geowebcache-cache-result: MISS

I’m rather confident that the HTTP query parameters align well with the layers I have cached. That is, I know I am:

  • Specifying the correct layer(s)

  • Specifying the correct height and width corresponding to the layer’s gridset(s)

  • Specifying the correct SRS/CRS (e.g. EPSG:4326) corresponding to the layer’s gridset(s)

  • Specifying the correct image format (PNG)

  • Specifying BBOX coordinates that are within the extend of the layer’s bounds

Is there anything else I’m doing wrong? Or is this whole WMS Cascading thing with GeoWebCache and cache layers not possible with GeoServer?

v/r

Ben

//SIGNED//

Benjamin Watson

MITRE Corporation

USSTRATCOM/J864

(402) 294-8119

DSN 271-8119

NIPR: watsonb@anonymised.com

SIPR: watsonb@anonymised.com

MITRE: bwatson@anonymised.com