[[PageOutline]] This page is part of the [wiki:Future MapGuide Future] section, where ideas are proposed and refined before being turned into RFCs (or discarded). Visit the [wiki:Future] page to view more! = Overview = This page is a living proposal for improving the scalability of the Tile Service. [[BR]] Mapguide supports tiled maps via both WMS and it's own Tile Service using GETTILETIMAGE. Recently support was added in Openlayers & Fusion to access the Tile Service via an API.[[BR]] [http://dev.openlayers.org/apidocs/files/OpenLayers/Layer/MapGuide-js.html OpenLayers. Layer. MapGuide][[BR]] [http://trac.openlayers.org/ticket/995 #995 (add support for MapGuide OS layer type) - OpenLayers - Trac][[BR]] = API Ideas = '''SETTILEIMAGE''' would allow the tile cache to seeded without needing to have remote access to the server file system. '''GETTILEPARAMS''' would return a list of scale ranges, tile sizes and bounds for a given tile cache. '''GETTILECACHE''' would return a 'map' of the tile cache, listing which tiles exist and which ones haven't yet been created '''HAVETILEIMAGE''' would enable a server to poll another server(s) in the cluster, [[BR]] returning status codes of 200 ok or 404 Not Found respectively. This allows the server to[[BR]] check the tile cache without triggering a tile render on the polled server. These would enable more extensive API based management of a cluster of Mapguide servers, via accurate seeding[[BR]] and management of the tile caches. = Cacheability by HTTP = [wiki:MapGuideRfc11] added support for a '''Stateless Http GETTILEIMAGE request''', however, these tiles are served [[BR]] without any cache headers which means they can only be proxied using a custom 'aggressive' proxy service. [[BR]] [ticket:467 Add proper cache headers & file date to GETTILEIMAGE response]. One of the the issues to be resolved is how long to set the cache headers to cache the tiles before checking back [[BR]] to the Mapguide Server. This could done with a serverconfig.ini default and then an overriding parameter in the [[BR]] ResourceHeader. == API additions to MgTileService == To support HTTP cacheability we need to be able to do the following via the MgTileService: a) Get timestamp information about a generated tile (to be able to apply expiry dates) b) "Peek" at the timestamp for a tile that may or may not be generated (to be able to compare against dates from if-modified-since headers) An API addition to MgTileService like the one below should be able to support the above scenarios. {{{ class MG_MAPGUIDE_API MgTileService : MgService { PUBLISHED_API: /// Returns the timestamp of when the tile for the specified map/group/row/col was generated. Returns NULL if no such tile exists /// MgDateTime* GetTileCreationDate(MgMap* map, CREFSTRING baseMapLayerGroupName, INT32 tileColumn, INT32 tileRow); /// Returns the timestamp of when the tile for the specified map/group/row/col/scale was generated. Returns NULL if no such tile exists /// MgDateTime* GetTileCreationDate(MgResourceIdentifier* mapDefinition, CREFSTRING baseMapLayerGroupName, INT32 tileColumn, INT32 tileRow, INT32 scaleIndex); /// Returns the specified base map tile for the given map. If a cached tile /// image exists it will return it, otherwise the tile is rendered and added /// to the cache. MgTile* GetTile(MgMap* map, CREFSTRING baseMapLayerGroupName, INT32 tileColumn, INT32 tileRow); /// Returns the specified base map tile for the given map. If a cached tile /// image exists it will return it, otherwise the tile is rendered and added /// to the cache. /// MgTile* GetTile(MgResourceIdentifier* mapDefinition, CREFSTRING baseMapLayerGroupName, INT32 tileColumn, INT32 tileRow, INT32 scaleIndex); }; }}} MgTile is defined like so. {{{ class MG_MAPGUIDE_API MgTile : public MgSerializable { PUBLISHED_API: /// Returns the tile image /// MgByteReader* GetImage(); /// Returns the date this tile was created /// MgDateTime* GetCreationDate(); }; }}} == MapAgent modifications == TBD = WMS = [ticket:286 WMS Cache headers] - see above. [ticket:285 Publish MapDefinitions via WMS] Currently only layers are exposed via WMS, maps could be as well. The WMS service doesn't currently use the tile cache, which means every WMS request is rendered. [[BR]] Linking the WMS service up to utilize the tile cache would dramatically improve the performance [[BR]] and capacity of WMS with Mapguide.[[BR]] = TMS = [wiki:GoogleSoC2007#TileMapServicePublishing TMS]