Context
The OSM tile usage policy requires:
- Cache tiles locally per HTTP caching headers (
Cache-Control, Expires, ETag) with a minimum 7-day fallback when headers aren't present
- Use conditional requests (
If-None-Match, If-Modified-Since) for expired tiles to avoid re-downloading unchanged tiles
- Never send
Cache-Control: no-cache or similar bypass directives (we're compliant here — we don't send these)
Current behavior
tiles_from_remote.dart fetches tiles with a plain GET and only checks the status code — response caching headers are ignored entirely
- No persistent tile cache with TTL tracking exists (flutter_map's in-memory cache evicts on map rebuild)
- Expired tiles are re-fetched unconditionally (no ETag/304 flow)
Expected behavior
- Parse
Cache-Control / Expires from tile responses and store tiles on disk with expiration metadata
- Default to 7-day cache when response headers are absent
- On cache expiry, send conditional requests (
If-None-Match / If-Modified-Since) and handle 304 Not Modified
Notes
This applies to all tile servers the app talks to, not just tile.openstreetmap.org.
Context
The OSM tile usage policy requires:
Cache-Control,Expires,ETag) with a minimum 7-day fallback when headers aren't presentIf-None-Match,If-Modified-Since) for expired tiles to avoid re-downloading unchanged tilesCache-Control: no-cacheor similar bypass directives (we're compliant here — we don't send these)Current behavior
tiles_from_remote.dartfetches tiles with a plain GET and only checks the status code — response caching headers are ignored entirelyExpected behavior
Cache-Control/Expiresfrom tile responses and store tiles on disk with expiration metadataIf-None-Match/If-Modified-Since) and handle304 Not ModifiedNotes
This applies to all tile servers the app talks to, not just
tile.openstreetmap.org.