globals:
  cache:
    base_dir: cache_data/
    meta_size: [1, 1]
    meta_buffer: 0

services:
  tms:
    # origin: 'nw'

layers:
  - name: wms_cache
    title: Direct Layer
    sources: [wms_cache]

  - name: wms_cache_isotime
    title: Direct Layer
    sources: [wms_cache_isotime]

  - name: wms_cache_png
    title: Direct Layer
    sources: [wms_cache_png]

caches:
  wms_cache:
    format: image/jpeg
    sources: [wms_source]
    refresh_before:
      seconds: 1

  wms_cache_isotime:
    format: image/jpeg
    sources: [wms_source]
    refresh_before:
      time: "2009-02-15T23:31:30"

  wms_cache_png:
    format: image/png
    sources: [wms_source]
    refresh_before:
      seconds: 1

sources:
  wms_source:
    type: wms
    req:
      url: http://localhost:42423/service
      layers: bar
    on_error:
      404:
        response: 'transparent'
        cache: False
      405:
        response: '#ff0000'
        cache: False
      406:
        response: 'transparent'
        cache: False
        authorize_stale: True
