This question is quite specific, but I actually couldn't find any information in the official docs. I would like to know what the expiration time of a file cache in MapProxy is (unlimited? according to upstream's cache control headers? something else) and whether it can be configured.
It seems that there is no expire time for tiles in a cache by default. In order to set an expiration time you can use the refresh_before
configuration on any cache.
Here you can force MapProxy to refresh tiles from the source while serving if they are found to be expired.
In addition, you also may set the amount of time web browsers will cache tiles with the expires_hours
global configuration under tiles
section (this configuration options is only for TMS/Tile service).
The number of hours a Tile is valid. TMS clients like web browsers will cache the tile for this time. Clients will try to refresh the tiles after that time. MapProxy supports the ETag and Last-Modified headers and will respond with the appropriate HTTP ‘304 Not modified’ response if the tile was not changed.