[Geoserver-users] 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

Ben

I cannot help you with all problems but may be with a few:

I am not surprised if GWC complains about 'EPSG;4326’. Please note you have
SEMIcolon in there.
The second: ‘My_EPSG:4326' should be fine if you define it properly in the
geowebcache.xml.
Google and lat/long are defined by default. There was a Mail in this list
which pointed out where, so please hunt, because you would need to define it
for instance with the same BBox.

The other error has to do with the GWC update policy. I do not know what the
defaults are, but it tries to update tiles after a certain time. You need to
turn this off with settings in the layer such as:

<wmsLayer>
.....................

<expireCache>-2</expireCache>
<expireClients>-1</expireClients>
<cacheBypassAllowed>false</cacheBypassAllowed>
<queryable>false</queryable>
</wmsLayer>

again in the geowebcache.xml
Now, I don't know how this works in the integrated Geoserver/GWC
environment, but it seems GWC is happy to accept Geoserver as tile source in
the config, but as it is cascaded it throws an error when it comes to update
where it would need the remote WMS, which you have cut.

Cheers

Christian

-----
____________________________

Dr Christian Maul
Project Manager

Information Services Branch
Department of Sustainability and Environment
Level13, Marland House, 570 Bourke Street
Melbourne 3000

PO Box 500, East Melbourne Vic 3002

Telephone: +61-3-8636 2325
Telefax: +61-3-8636 2813
--
View this message in context: http://osgeo-org.1560.n6.nabble.com/GeoServer-Caching-question-tp5025516p5025554.html
Sent from the GeoServer - User mailing list archive at Nabble.com.

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

--
View this message in context: http://osgeo-org.1560.n6.nabble.com/GeoServer-Caching-question-tp5025516p5025674.html
Sent from the GeoServer - User mailing list archive at Nabble.com.

Jonathan,

the difference is probably in the request:

http://localhost:6080/geoserver/wms?service=WMS&version=1.1.0&request=GetMap&layers=bushfire_prone_areas&styles=&bbox=140.962,-39.137,149.972,-33.982&width=576&height=330&srs=EPSG:4283&format=application/openlayers

http://localhost:6080/geoserver/gwc/demo/bushfire_prone_areas?gridSet=EPSG:4326&format=image/png

The first one gets you an image from a particular layer via Geoserver the
second one goes to accesses the cache and creates the image if they are not
there.

Cheers

Christian

-----
____________________________

Dr Christian Maul
Project Manager

Information Services Branch
Department of Sustainability and Environment
Level13, Marland House, 570 Bourke Street
Melbourne 3000

PO Box 500, East Melbourne Vic 3002

Telephone: +61-3-8636 2325
Telefax: +61-3-8636 2813
--
View this message in context: http://osgeo-org.1560.n6.nabble.com/GeoServer-Caching-question-tp5025516p5026074.html
Sent from the GeoServer - User mailing list archive at Nabble.com.