2

I've just started looking at the cache expiration parameters for GeoWebCache and came across something that really confused me. In the documentation it says in its explanation for the <minZoom> parameter;

First zoom level. The list should always start with 0 and be monotonically increasing.

For a start, I don't understand what monotonically increasing really means. With a bit of saerching it looks like it means that it should go up in regular steps. It then gives this as an example

<expireCacheList>
  <expirationRule minZoom="0"  expiration="14400" />
  <expirationRule minZoom="10" expiration="7200" />
</expireCacheList>

So lets say I wanted to cache everything between 0 and 9 for a month, 10 and 15 for a week, and 16 and above for a day. Could I do it like this.

    <expireCacheList>
      <expirationRule minZoom="0"  expiration="[insert num seconds in month here]" />
      <expirationRule minZoom="10" expiration="[insert num seconds in week here]" />
      <expirationRule minZoom="15" expiration="[insert num seconds in day here]" />
    </expireCacheList>

Or would it have to be like this

    <expireCacheList>
      <expirationRule minZoom="0"  expiration="[insert num seconds in month here]" />
      <expirationRule minZoom="5"  expiration="[insert num seconds in month here]" />
      <expirationRule minZoom="10" expiration="[insert num seconds in week here]" />
      <expirationRule minZoom="15" expiration="[insert num seconds in day here]" />
    </expireCacheList>

Does anyone also happen to know off hand if this requires a reload of the GeoServer configuration or whether it applies as soon as you save the XML file. The documentation is a bit flaky and I'd like to understand it a bit better before going any further. I don't want to be responsible for bringing down our GeoServer (again...) so any help or pointers is much appreciated.

3

Monotonically increasing is a maths term that roughly means that "the next one is greater than this one". It doesn't have to be by the same amount each time.

So in the context of GeoWebCache configuration, the code expects that the expiration rules increase in zoom level.

You've pretty much got it in your second example:

<expireCacheList>
  <expirationRule minZoom="0"  expiration="[insert num seconds in month here]" />
  <expirationRule minZoom="10" expiration="[insert num seconds in week here]" />
  <expirationRule minZoom="15" expiration="[insert num seconds in day here]" />
</expireCacheList>

Note that this will expire tiles from zoom levels 0...9 after one month, 10...14 after one week, and 15 upwards after one day.

If you really wanted 0 and 9 for a month, 10 and 15 for a week, and 16 and above for a day, it would look like:

<expireCacheList>
  <expirationRule minZoom="0"  expiration="[insert num seconds in month here]" />
  <expirationRule minZoom="10" expiration="[insert num seconds in week here]" />
  <expirationRule minZoom="16" expiration="[insert num seconds in day here]" />
</expireCacheList>

The change is in the last minZoom value.

GeoWebCache configuration is not going to be applied when you save the file - you have to reload the configuration. There are three ways to do this, as explained in the documentation. The web interface is probably the easiest of those three ways.

  • I love it when one of my old ignored questions gets an answer. And a great thorough answer as well, thanks! – Rob Quincey Apr 11 '14 at 7:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.