Optimization of SuperMap iServer REST services

Feedback


To optimize REST services is to improve the capacity of GIS services, so that clients' map requests can be responded quickly. Therefore SuperMap iServer REST services provide users an image caching mechanism, multiple output formats, and options for setting image parameters for possible optimization. GIS service capacity can achieve an optimal level if those contents are set properly.

If-Modified-Since is supported in request headers

SuperMap iServer REST services can support If-Modified-Since as the label of an HTTP request header. Users can add the If-Modified-Since label in an HTTP request header when sending the HTTP request to a REST service. The time at which the cached page of the browser is modified the last time can also be sent to the server. The REST service then compares the time when files are cached on the client with the time when the files on the server are actually modified.

Representation types

REST resources support many output formats for representation, such as HTML, XML, JSON, RJSON, as well as special output formats for image resources -- PNG, BMP, GIF, JPG/JPEG, etc.

In most cases, HTML is the default output format as most browsers support HTML. However, HTML is not the best for representation because it does not respond very fast.

When a user only needs to retrieve images without any other data information, he/she can choose one of the output formats for images, such as PNG. Unlike with other output formats, images can be directly returned to the client in the form of data flow without other data- or service-related information. The JSON output format has become the mainstream for representation due to its easiness to parse, relatively small size, and low bandwidth requirement.

Image parameters

The parameters of output images, including the image size and format, can be set in a map REST service.

The image size will affect the time a REST service needs for processing a map. Images with large sizes are also affected by the transmission performance of the network. Setting a proper image size can improve the processing speed of a REST service and reduce the network transmission time, thus improve the performance of exporting images.

Currently, a number of output formats for images are supported in REST services, including PNG, BMP, GIF, and JPG/JPEG.

In most cases, JPG/JPEG is employed for maps with abundant colors such as remote sensing images. PNG and JPG are usually used for images exported from vector data. Although BMP and GIF are also supported in SuperMap iServer, they are not commonly used.

The life cycle of the temporary child resources

Please refer to The life cycle of the temporary child resources for more details about the policy used for lengthening the life cycle of the temporary child resources in SuperMap iServer.