I've spent the last two days trying my hand at GeoWebCache. I've had some issues and am now out the office so can't access any code to attach. I know if i don't post this it'll bug me all weekend.

I've been using GeoServer WMS on demand from my OpenLayers app but wanted to make use of the integrated GeoWebCache. (a) do I have to use WMTS to use the cache? My current thinking is yes and I have changed my code accordingly. my new WMTS url points to geoserver/gwc/service/wmts.

So i went and configured my geowebcache.xml to include the BNG 27700 gridset. I also included 14 resolutions that correspond to my app's map scales. Map and gridset both return 256x256 tiles. No problem. I edit my layer.xml for the desired layers to include my gridset. My Catalina.out shows this is all fine when i start tomcat5. I've read i need to have a different layer name in my geowebcache.xml to the actual layer in geoserver. (b2) is this true?

My app then makes some very slow WMTS requests which take upto a minute to comeback. Significantly slower than my previous WMS. (c) Why? . I've tried png, png8 and jpeg. (d) which is quickest? Currently favour png8. I'm using mastermap area data with an simple SLD. No labels or transparency so i'm not sure why it's so slow.

I see my pyramids begin to build in the gwc directory when i make these horribly slow requests. However, when i make exactly the same request again, the tiles are replaced in the cache rather than consumed. Obviously there is no performance benefit as a result. (e) Why are my tiles replaced? I am not setting any expiry details so presume the metastore should handle this.

When i went to revert back to my previously quickish WMS request they too were now very slow. (f) Is this related? Bouncing the server didn't help.

Details: GeoServer/GeoWebCache is on a RHEL 16GB RAM machine. The cache store limit is set to 5GB which I'm nowhere near. I have the latest versions of both apps.

OK cheers for the pointers. I'll keep my old WMS decalaration for simplicity. I don't think seeding is an option in this case. Any idea why the tiles are always replaced and not reused?
–
geo_jamesMar 12 '12 at 9:48

(B2) When you will try to request getCapabilities for the WMTS layer and layer name has same name in geowebcache.xml you will get the response which contains capabilities of two layers with the same name but different . If you are getting layers on client via OpenScales you'll notice that HashMap of my:Layer will be broken.

Different names in geowebcache.xml will be the right choice.
For example: