defaults.rst 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251
  1. .. _gwc_webadmin_defaults:
  2. Caching defaults
  3. ================
  4. The Caching Defaults page shows the global configuration options for the tile caching functionality in GeoServer, an embedded GeoWebCache.
  5. GWC Provided Services
  6. ---------------------
  7. In addition to the GeoServer endpoints, GeoWebCache provides other endpoints for OGC services. For example, the GeoServer WMS endpoint is available at::
  8. http://GEOSERVER_URL/wms?...
  9. The GeoWebCache WMS endpoint is::
  10. http://GEOSERVER_URL/gwc/service/wms?...
  11. .. figure:: img/defaults_services.png
  12. Provided services
  13. The following settings describe the different services that can be enabled with GeoWebCache.
  14. Enable direct integration with GeoServer WMS
  15. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  16. Direct integration allows WMS requests served through GeoServer to be cached as if they were received and processed by GeoWebCache. This provides all the advantages of using a tile server while still employing the more-flexible GeoServer WMS as a fallback. See the section on :ref:`gwc_using` for more details about this feature.
  17. With direct integration, tile caching is enabled for all standard WMS requests that contain the ``tiled=true`` parameter and conform to all required parameters.
  18. This setting is disabled by default. When enabling this option, it is a good idea to also turn on :ref:`gwc_webadmin_diskquotas` as well, to prevent unbounded growth of the stored tiles.
  19. Explicitly require TILED Parameter
  20. ``````````````````````````````````
  21. When this parameter is checked direct WMS integration requires that the ``tiled=true`` parameter be set in all requests that will be cached. If this parameter is unchecked all incoming requests will be considered for caching, the request must still conform to all required parameters.
  22. Enable WMS-C Service
  23. ~~~~~~~~~~~~~~~~~~~~
  24. Enables the Cached Web Map Service (WMS-C) service. When this setting is enabled, GeoWebCache will respond to its own WMS-C endpoint::
  25. http://GEOSERVER_URL/gwc/service/wms?SERVICE=WMS&VERSION=1.1.1&TILED=true&...
  26. When the service is disabled, calls to the capabilities document will return a ``Service is disabled`` message.
  27. Enable TMS Service
  28. ~~~~~~~~~~~~~~~~~~
  29. Enables the Tiled Map Service (TMS) endpoint in GeoWebCache. With the TMS service, GeoWebCache will respond to its own TMS endpoint::
  30. http://GEOSERVER/URL/gwc/service/tms/1.0.0
  31. When the service is disabled, calls to the capabilities document will return a ``Service is disabled`` message.
  32. Enable WMTS Service
  33. ~~~~~~~~~~~~~~~~~~~
  34. Enables the Web Map Tiled Service (WMTS) endpoint in GeoWebCache. When this setting is enabled, GeoWebCache will respond to its own WMTS endpoint::
  35. http://GEOSERVER/URL/gwc/service/wmts?...
  36. When the service is disabled, calls to the capabilities document will return a ``Service is disabled`` message.
  37. HTTP RESTful API is available through the existing GWC integration allowing clients to retrieve the following resources:
  38. * capabilities document
  39. * tile
  40. * feature info
  41. For more information read `GWC WMTS documentation <http://geowebcache.org/docs/current/services/wmts.html>`_.
  42. Enable Data Security
  43. ~~~~~~~~~~~~~~~~~~~~
  44. Enables the :ref:`gwc_data_security` in the embedded GeoWebCache.
  45. Default Caching Options for GeoServer Layers
  46. --------------------------------------------
  47. This section describes the configuration of the various defaults and other global options for the tile cache in GeoServer.
  48. .. figure:: img/defaults_options.png
  49. Default caching options
  50. Automatically configure a GeoWebCache layer for each new layer or layer group
  51. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  52. This setting, enabled by default, determines how layers in GeoServer are handled via the embedded GeoWebCache. When this setting is enabled, an entry in the GeoWebCache layer listing will be created whenever a new layer or layer group is published in GeoServer. Use this setting to keep the GeoWebCache catalog in sync. (This is enabled by default.)
  53. Automatically cache non-default styles
  54. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  55. By default, only requests using the default style for a given layer will be cached. When this setting is enabled, all requests for a given layer, even those that use a non-standard style will be cached. Disabling this may be useful in situations where disk space is an issue, or when only one default style is important.
  56. Default metatile size
  57. ~~~~~~~~~~~~~~~~~~~~~
  58. A metatile is several tiles combined into a larger one. This larger metatile is generated and then subdivided before being served back (and cached) as standard tiles. The advantage of using metatiling is in situations where a label or geometry lies on a boundary of a tile, which may be truncated or altered. With metatiling, these tile edge issues are greatly reduced.
  59. Moreover, with metatiling, the overall time it takes to seed the cache is reduced in most cases, when compared with rendering a full map with single tiles. In fact, using larger metatiling factors is a good way to reduce the time spent in seeding the cache.
  60. The disadvantage of metatiling is that at large sizes, memory consumption can be an issue.
  61. The size of the default metatile can be adjusted here. By default, GeoServer sets a metatile size of **4x4**, which strikes a balance between performance, memory usage, and rendering accuracy.
  62. Default gutter size
  63. ~~~~~~~~~~~~~~~~~~~
  64. The gutter size sets the amount of extra space (in pixels) used when generating a tile. Use this in conjunction with metatiles to reduce problems with labels and features not being rendered incorrectly due to being on a tile boundary.
  65. Default Cache Formats
  66. ~~~~~~~~~~~~~~~~~~~~~
  67. This setting determines the default image formats that can be cached when tiled requests are made. There are four image formats that can be used when saving tiles:
  68. * PNG (24-bit PNG)
  69. * PNG8 (8-bit PNG)
  70. * JPEG
  71. * GIF
  72. The default settings are subdivided into vector layers, raster layers, and layer groups. You may select any of the above four formats for each of the three types of layers. Any requests that fall outside of these layer/format combinations will not be cached if sent through GeoServer, and will return an error if sent to the GeoWebCache endpoints.
  73. These defaults can be overwritten on a per-layer basis when :ref:`editing the layer properties <data_webadmin_layers>`.
  74. .. figure:: img/defaults_formats.png
  75. Default image formats
  76. In Memory BlobStore Options
  77. ~~~~~~~~~~~~~~~~~~~~~~~~~~~
  78. These options are used for enabling/disabling In Memory Caching for GeoWebCache. This feature can be used for saving GWC tiles directly in memory, for a fast data retrieval.
  79. Enable
  80. ``````
  81. This parameter allows to enable or disable in memory caching. By default it is disabled.
  82. Avoid Persistence
  83. `````````````````
  84. This parameter can be used to prevent the saving of any file in the file system, keeping all the GWC tiles only in memory. By default it is disabled.
  85. Available Caches
  86. ````````````````
  87. This parameter defines which Cache method can be used for In Memory Caching. By default the Guava Caching is used. Note that if a caching method
  88. requires an immutable configuration at GeoServer startup like HazelCast, the *Hard Memory limit*, *Eviction Policy*, *Eviction Time* and *Concurrency Level*
  89. parameters are disabled.
  90. More information on how to configure a new Cache object can be found in the GeoWebCache :ref:`gwc_config` page.
  91. Cache Hard Memory limit (Mb)
  92. ````````````````````````````
  93. Parameter for configuring in memory cache size in MB.
  94. Cache Eviction Policy
  95. `````````````````````
  96. Parameter for configuring in memory cache eviction policy, it may be: LRU, LFU, EXPIRE_AFTER_WRITE, EXPIRE_AFTER_ACCESS, NULL
  97. This eviction policies may not be supported by all caches implementations. For example, Guava Caching only supports the eviction policies: EXPIRE_AFTER_WRITE, EXPIRE_AFTER_ACCESS and NULL.
  98. Note, only the eviction policies accepted by the selected cache will be shown on the UI.
  99. Cache Eviction Time (in Seconds)
  100. ````````````````````````````````
  101. Parameter for configuring in memory cache eviction time. It is in seconds.
  102. .. note:: Note that this parameter is also used for configuring an internal thread which performs a periodical cache cleanup.
  103. Cache Concurrency Level
  104. ```````````````````````
  105. Parameter for configuring in memory cache concurrency.
  106. Clear In Memory Cache
  107. `````````````````````
  108. Button for clearing all the tiles in the in memory cache.
  109. Cache Statistics
  110. ````````````````
  111. Various statistics parameters associated with the in memory cache.
  112. Update Cache Statistics
  113. ```````````````````````
  114. Button for updating cache statistics seen above. The statistics are always related to the local cached entries, even in case of distributed in memory caching
  115. .. note:: Note that some Caches do not provide all the statistics parameters, in that case the user will only see *"Unavailable"* for those parameters.
  116. .. figure:: img/blobstoreoptions.png
  117. :align: center
  118. *In Memory BlobStore Options*
  119. .. note:: Note that in the *TileCaching* tab for each Layer, you may decide to disable in memory caching for the selected Layer by clicking on the **Enable In Memory Caching for this Layer** checkbox. This option is disabled for those caches which don't support this feature.
  120. Skip caching on dimension warnings
  121. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  122. WMS dimension handling can be complex, with ability to return tiles where the specified time
  123. was not a match, or when the request contained no time at all.
  124. This may not be a good match for tile caching, as it breaks the unique link between URL and tile content.
  125. The following settings allow to disable caching when a WMS dimension warning is issued:
  126. .. figure:: img/skipCacheWarnings.png
  127. :align: center
  128. *Skip caching on cache warnings*
  129. The best settings depend on the type of dataset and disk-quota configurations:
  130. * For **static datasets with dimensions**, the default value skip could be removed, as it's going to
  131. generate at most one copy of the tiles. The nearest match and failed nearest
  132. could be cached if there is a disk quota (to speed up clients that repeatedly fail to perform an exact time match),
  133. but it's best not to cache it if there is no disk quota, as the mismatches can be potentially infinite, leading to
  134. an uncontrolled growth of the cache.
  135. * For a **datasets growing over time**, it's better to disable caching on the default value, as it's often
  136. the "latest", that is, the most recently added to the dataset. This means the tiles contents
  137. change based on when they are asked for. The considerations for nearest and failed matches
  138. are the same as for the static datasets.
  139. Caution is advised if the data ingestion might happen to skip some time/elevation values,
  140. to fill them only at a later time. In this case, nearest matches could cause the system to cache
  141. a tile for a nearby time value, which would hide the actual values if they get ingested at a later time.
  142. Default Cached Gridsets
  143. ~~~~~~~~~~~~~~~~~~~~~~~
  144. This section shows the gridsets that will be automatically configured for cached layers. While there are some pre-configured gridsets available, only two are enabled by default. These correspond to the most common and universal cases:
  145. * EPSG:4326 (geographic) with 22 maximum zoom levels and 256x256 pixel tiles
  146. * EPSG:900913 (spherical Mercator) with 31 maximum zoom levels and 256x256 pixel tiles
  147. .. figure:: img/defaults_gridsets.png
  148. :align: center
  149. *Default gridsets*
  150. To add a pre-existing grid set, select it from the :guilabel:`Add default grid set` menu, and click the Add icon (green circle with plus sign).
  151. .. figure:: img/addexistinggridset.png
  152. :align: center
  153. *Adding an existing gridset to the list of defaults*
  154. These definitions are described in more detail on the :ref:`gwc_webadmin_gridsets` page.