GeoWebCache is automatically configured to be used with GeoServer with the most common options, with no setup required. All communication between GeoServer and GeoWebCache happens by passing messages inside the JVM.
By default, all layers served by GeoServer will be known to GeoWebCache. See the GeoWebCache Demo page page to test the configuration.
The GEOSERVER_WMS_URL parameter in web.xml, used in earlier versions of GeoServer, is deprecated and should not be used.
Changing the cache directory¶
GeoWebCache will automatically store cached tiles in a gwc directory inside your GeoServer data directory. To set a different directory, stop GeoServer (if it is running) and add the following code to your GeoServer web.xml file (located in the WEB-INF directory):
<context-param> <param-name>GEOWEBCACHE_CACHE_DIR</param-name> <param-value>C:\temp</param-value> </context-param>
Change the path inside <param-value> to the desired cache path (such as C:\temp or /tmp). Restart GeoServer when done.
Make sure GeoServer has write access in this directory.
If you need to access more features than the automatic configuration offers, you can create a custom configuration file. Inside the GeoWebCache cache directory (see above), create a file named geowebcache.xml. Please refer to the GeoWebCache documentation for how to customize this file. Restart GeoServer for the changes to take effect. You may also wish to check the logfiles after starting GeoServer to verify that this file has been successfully read.