staticmaps
staticmaps copied to clipboard
tileRequestLimit: limit concurrent connections
Due to new limitations of the OSM tiles usage policy I added tilesRequestLimit
in [email protected] option to limit concurrent connections to the tiles server. This value is set to 2 by default and can be overwritten or disabled with tilesRequestLimit: 0
.
@OlivierKamers FYI
Nice 👍
I also saw the update to get rid of the request library. I played around with it a few weeks ago because we had issues parallelising multiple map renderings. I added an option to provide a custom tile loader function (so we can use our blob storage functions and some memoization) but it looks like the got
library you're using now might already take care of the issues we had. I haven't been able to clean up the implementation yet so that's why I didn't propose the change here, and it's just on a branch in our fork: https://github.com/Sitemark/staticmaps/commit/5084341d87d19940659a8b59473f37088b546916
What kind of issues?
I had to limit the number of requests to avoid timeouts from the request library. Externalising the function also allowed me to use a cache for tiles that are requested more than once.
Ok, that could indeed be an improvement. I thought for now caching should be done at the tiles server side, for example via CDN.