Skip to content

Reduce caching duration for low zoom tiles to match actual rerender schedule - #876

Merged
Firefishy merged 1 commit into
openstreetmap:masterfrom
leijurv:lowzoom-cache-duration
Oct 17, 2026
Merged

Firefishy merged 1 commit into
openstreetmap:masterfrom
leijurv:lowzoom-cache-duration

Conversation

@leijurv

@leijurv leijurv commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

The HTTP caching for tiles is 6 days for Z0-Z9 and 1 day for Z10-Z13.

Since 6410e8b, the low zoom render happens every day. But this is mostly a waste because each individual Fastly POP is caching Z0-Z9 for a week. So users don't actually see updated tiles every day.

The original intent we can see here https://github.com/openstreetmap/mod_tile/blob/f19e45388733ee9a3c64e1f878fb8dee4cd05a20/src/mod_tile.c#L597 is that the cache time should align with the rerender schedule. Which makes sense. If it's less, then fastly/browser is refetching the same data. That's not so bad because of the ETag, If-None-Match, fastly returns 304 and doesn't actually send the tile. If it's more, then the tileservers are making tiles that won't be seen.

This PR changes the config to match the actual tileserver behavior. For the daily rerender, we'll call that "low zoom" and cache it for 1 day. Mid zoom is an arbitrary distinction, it doesn't need to exist, but I left it just for clarity. High zoom stays unchanged. The HTTP caching becomes 1 day for Z0-Z13. It was already that for Z10-Z13, so this change only affects Z0-Z9, whose tiles only sum up to roughly a gigabyte or maybe less. So the upside of fresh lowzoom tiles is probably worth it I think.

@Firefishy
Firefishy merged commit 80aff1e into openstreetmap:master Oct 17, 2026
122 of 125 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants