Book Image

GeoServer Cookbook

By : Stefano Iacovella
Book Image

GeoServer Cookbook

By: Stefano Iacovella

Overview of this book

Table of Contents (17 chapters)
GeoServer Cookbook
Credits
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Preface
Index

Managing cache tiles with the GWC REST API


Managing the cache is a more complex task than just managing the layer configuration. Cache is composed of map tiles that you may create at once by seeding the layer or waiting for the users to issue GetMap requests that have gone through the GeoWebCache and are stored as maps tile in the GeoWebCache repository.

The GWC REST interface supports the seeding, truncating, and managing tiles of cached layers.

How to do it…

  1. Create a new XML file, insert the following code, and save it as seedCoastline.xml:

    <seedRequest>
      <name>NaturalEarth.Coastline</name>
      <srs>
        <number>4326</number>
      </srs>
      <zoomStart>1</zoomStart>
      <zoomStop>8</zoomStop>
      <format>image/png</format>
      <type>seed</type>
      <threadCount>4</threadCount>
    </seedRequest>
  2. Send a cURL request to start seeding for the NaturalEarth:Coastline layer:

    $ curl -u admin:geoserver -XPOST...