[Geoserver-users] geoserver cannot cache with gwc

Hi,

Most often caching does not happen because requests which are sent by the client does not suit with the tiles of the requested gridset. Unfortunately I can't read the code well enough to understand even which projection your client is using for GetMap calls.

-Jukka Rahkonen-

-----Alkuperäinen viesti-----
Lähettäjä: Pena Kupen [mailto:kupen@anonymised.com]
Lähetetty: 3. heinäkuuta 2014 21:22
Vastaanottaja: geoserver-users@lists.sourceforge.net
Aihe: [Geoserver-users] geoserver cannot cache with gwc

Hi,

I'm not sure, if this it geoserver case or geowebcache case, but...

My layer has following definitions (automatically coming from WMS server,
when creating store) Native SRS
EPSG:3067
Declared SRS
EPSG:3067
SRS handling
force declared

Bounding Boxes
Native Bounding Box
56.000 6,594.000 740.000 7,782.000
Lat/Lon Bounding Box
22.5 56.25 28.125 61.875

All seems to work with my app, when not caching (TILED: false). When I try to
use with GWC, caching is not happening (TILED: true).
I'm using layer with Openlayers with following:

MAP_TILE = new OpenLayers.Layer.WMS("Map tile",

  "http://localhost:8080/geoserver/wms",

         {layers: 'MAP_WMS:base',
format:'image/png', transparent: true, TILED: true},

         {opacity: 1.0, isBaseLayer: true,
visibility: true, minScale: 100000, maxScale: 10000}

         );
var asteet = new OpenLayers.Projection("EPSG:4326");
var mercator = new OpenLayers.Projection("EPSG:900913");
var suomi = new
OpenLayers.Bounds(18.61,59.57,31.85,70.23).transform(asteet, mercator);

var map = new OpenLayers.Map('map', {

  projection: mercator,

  units: "m",

  maxExtent: suomi,

  restrictedExtent :suomi
          });

Any idea, how to get GWC working.

--kupen

--
Wippies-vallankumous on täällä! Varmista paikkasi vallankumouksen
eturintamassa ja liity Wippiesiin heti!
http://www.wippies.com/

------------------------------------------------------------------------------
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

First off, if you want to use the standard GeoServer WMS endpoint with caching, you need to make sure that you have Direct Integration enabled.

Second, you need to make sure the layer is configured for caching and that you have set it up with the correct format, gridset, parameter filters, et to handle your request. If anything doesn’t match, it will fall back to using GeoServer’s WMS service directly without any caching.

OpenLayers isn’t able to read the gridset information from a WMS-C GetCapabilities document so if you give it a layer using a custom gridset it will simply guess how the tiles are laid out and make requests on that basis. If it guesses wrong, then the requests won’t line up with the cache and GWC won’t be able to handle it. If you’re using GWC directly you’ll get an error, while if you’re using the regular GeoServer WMS endpoint with Direct Integration enabled, it will fall back to using the WMS without caching.

If you want to ensure that things are cached, use a dedicated GWC endpoint instead as it will fail outright if you get anything wrong rather than silently skipping caching. The GWC endpoints are /geoserver/gwc/service/wms, /geoserver/gwc/service/tms, and /geoserver/gwc/service/wmtsdepending on which protocol you prefer. You don’t need Direct Integration enabled if you are doing this.

In order to use any gridset other than the standard Web Mercator or WGS84 ones you have to tell OpenLayers the exact parameters of that gridset, at least if you’re using WMS-C. You may have better luck with TMS or WMTS. If you look at the GWC layer preview (not the regular GeoServer one) it will use OpenLayers 2 with the necessary information so you can take a look at how you need to set things up.