Originally posted by BR14
View Post
So the user positions the slippy map (like Google Maps, where the map is actually lots of smaller images tiled together) on the area and at the zoom level they want, then submits the request; but it'll be a few seconds, at least, before it's ready.
By putting the rendering on a background task, the web server can send an immediate response saying "OK, request received and understood, I'm drawing that, it'll be ready whenever." It makes for a better user experience than sitting staring at the browser progress bar for ages, wondering if it's crashed or something.
And the business of intercepting requests for maps that don't exist is so that the server can look and see if that's one of the ones it's sent off to be done in the background. If it's in the queue, it can say it's not ready yet, or even (maybe) say it's going to be another two minutes, or it's 80% done, or whatever. And if it isn't one that's in the queue, it can just send back 404 Not Found as normal.
And as and when the map has finally been drawn, all future requests for it will just be sent the image file directly, now that it exists
I may not end up using it that way, but it was all easy enough to get working, so it was worth prototyping it just to have it to play with
Comment