/** * Gets the expiration time for tiles in the cache, based on the expiration rules from {@link * GeoServerTileLayerInfo#getExpireCacheList()}. If no matching rules are found, defaults to * {@link GeoServerTileLayerInfo#getExpireCache()} * * @see org.geowebcache.layer.TileLayer#getExpireCache(int) * @param zoomLevel the zoom level used to filter expiration rules * @return the expiration time for tiles at the given zoom level */ @Override public int getExpireCache(int zoomLevel) { if (info.getExpireCacheList() != null) { ExpirationRule matchedRule = null; for (ExpirationRule rule : info.getExpireCacheList()) { if (zoomLevel >= rule.getMinZoom()) { matchedRule = rule; } else { // ExpirationRules should be zoomlevel ascending break; } } if (matchedRule != null) { return matchedRule.getExpiration(); } } return info.getExpireCache(); }