In typical HN fashion, I would suggest looking into using Tippecanoe to generate some vector tiles of the data and host that on S3. Then the DB can fall back to performing simple lookups via the accident ID. Filtering by time will need to move to the frontend, but that should be fine (if not, look into clustering the data at further zoom levels).
If the bottle-neck is the DB and you haven't enabled the PostGIS extension, I'd look into that as the other commenter mentioned. If it's your server, then yes look into pre-generating all the tiles and hosting them elsewhere, but this might then mean switching over to MapLibre/Mapbox (which is what most companies end up using because of Leaflet's limitations).
For filtering on the frontend, I'd look into Expressions so you're not regenerating the GeoJSON collection every time (this causes a significant delay and flicker).
- https://maplibre.org/maplibre-style-spec/expressions/
- https://maplibre.org/maplibre-gl-js/docs/examples/hover-styl...
We were also recently featured on the motherduck blog https://motherduck.com/blog/pushing-geo-boundaries-with-moth...
Is your server on that list?
j/k, I’m sorry, I’ll see myself out XD