Feature Request / Discussion: Implement If-Modified-Since header to allow for better caching #246
saosebastiao
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
File this under "It would be nice, but it could also be too complex to bother with".
The If-Modified-Since header could be used to reduce IO with the database via conditional caching.
This would require a way of communicating from the database to the martin server when the underlying data sources have been modified. This could be done using Postgres' existing LISTEN/NOTIFY directives.
The way I see it working is that if it is configured for use, a table source (say public.points) would have an associated LISTEN channel (in this case
LISTEN "public.points";
), and it would fall onto the user to implement the method for NOTIFYing when the table source has been updated. We could provide example triggers that would notify on insert/update.Thus an upstream reverse proxy (like NGINX, with its
proxy_cache_revalidate
directive) could effectively cache tiles and only invalidate that cache and request the full tile again when the underlying data source is updated.If this request is worth entertaining, we might be able to work on a Pull Request together for your review.
Beta Was this translation helpful? Give feedback.
All reactions