In order to upgrade the WebGIS legacy systems smoothly, and improve the response speed of traditional WebGIS and user experience, this paper designs and develops a tile map service based on middleware technology. Through systematic analysis of its basic principle and system architecture, this paper gives several optimization strategies. Finally, we make a performance comparison between tile map service middleware and traditional OGC (Open Geospatial Consortium, OGC) standard WMS service. Our experimental results show that the average response time of tile map service reduced by 46% than sending WMS request to WMS server directly, and the TMS middleware has a high efficiency when cutting map tiles dynamically because of its meta-tiling strategy. The study shows that tile map service middleware has important application value both in improving traditional WebGIS performance and in upgrading existing legacy systems.