Changes between Version 3 and Version 4 of Future/TileServiceEnhancements


Ignore:
Timestamp:
Jun 26, 2013, 4:51:16 AM (11 years ago)
Author:
jng
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Future/TileServiceEnhancements

    v3 v4  
    9595== MapAgent modifications ==
    9696
    97 TBD
     97These API changes do not really affect the mapagent interface. From a calling client's perspective, they should still be able to send v1.2.0 GETTILEIMAGE requests with the same parameters and take advantage of HTTP caching behind the scenes. Behind the scenes the GETTILEIMAGE operation handler simply needs to check for the existence of a "If-Modified-Since" request header to take on a new code path.
     98
     99A rough pseudocode overview of this process would be
     100
     101{{{
     102
     103if (ifModifiedSince header exists) {
     104    extract date from header
     105    call GetTileCreationDate
     106    if (tileCreationDate != NULL) {
     107        if (tileCreationDate is newer than header date) {
     108            call new GetTile
     109            write image from MgTile into result
     110            write date from MgTile into last modified response header
     111            write expires date a long period from that date (6 months? 1 year?)
     112        } else {
     113            set status code of 304. Write nothing into the result. Outer CGI/Apache/ISAPI handler is expected to handle this and write out the appropriate responses (see below)
     114        }       
     115    } else {
     116        call new GetTile
     117        write image from MgTile into result
     118        write date from MgTile into last modified response header
     119        write expires date a long period from that date (6 months? 1 year?)
     120    }
     121} else {
     122    call new GetTile
     123    write image from MgTile into result
     124    write date from MgTile into last modified response header
     125    write expires date a long period from that date (6 months? 1 year?)   
     126}
     127}}}
     128
     129In our applicable CGI/Apache/ISAPI handlers, their additional responsibilities are to:
     130
     131 * Pack any HTTP request headers into the request metadata of the MgHttpRequest before executing it. In the case of this API, look for if-modified-since
     132 * Handle the 304 internal status and write out any applicable response headers from the MgHttpResult that operations supporting HTTP cacheability (ie. The GETTILEIMAGE) should provide.
     133
     134MgHttpRequestMetadata and MgHttpHeader classes are not currently used in any of the existing CGI/Apache/ISAPI handlers. We should use them for this purpose.
    98135
    99136= WMS =
     
    112149[wiki:GoogleSoC2007#TileMapServicePublishing TMS]   
    113150
    114