Experimental: Using PostgreSQL Query Cache

Rendering PDF, PNG and SVG output makes Mapnik execute the same set of queries three times in a row. This has two effects:

  • rendering takes longer as queries are re-executed
  • output of the different formats may differ as data may have changed in between

By using the PostgreSQL Query Cache with a cache time of 10 minutes rendering the additional formats takes less time as query results can be reused, this also guarantees that all three formats are rendered using the same data.

On the other hand re-issuing a render request within less than ten minutes will not show changed data. This shouldn’t be much of an issue though as right now OSM changes are only processed every 15 minutes anyway.

Leave a Reply

Your email address will not be published. Required fields are marked *