This is a simple tarantool-based application to cache map tiles from ESRI ArcGIS. It is built with Lua.
It has two storage spaces, hot and cold, the first one is stored in RAM and is very fast. The second is stored on disk and is slower. Tiles which have been accessed recently are moved to the hot storage, as they grow stale they are moved to the cold stoage. Currently the treshold is set to two minutes.
The collection of tiles from hot to cold storage is done using fibers which are cooperative lightweight threads. In a real scenario, another process (or even more than one can be used to collect tiles).
- Tarantool 1.7+
- tarantool-fiber
- tarantool-http
To run the little server use:
$ tarantool app.lua
Call it with curl like:
$ curl -v "http://localhost:8080/ArcGIS/cache/World_Street_Map/5/17/19"
If that tile is not cached, then it will request from ArcGIS and cache.