I have multiple tables of data in my PostgreSQL database that have wkb_geometry columns used to generate layers. I would like to allow users to select which layers on a map they will see by accessing UI components such as checkboxes. When doing so, based on the selected UI components, it should send a request to my tile server and update the Mapnik XML file accordingly before rendering the tiles. How can I do this without having to restart renderd each time and how can I make sure that concurrent accesses won't overwrite changes to my XML file?
I do not want to cache these tiles as the same URL could have different parameters (layers turned on) so how would I avoid caching these requests?