iServer Cache Topic

Feedback


 

1. Cache methods supported by iServer

SuperMap iServer supports multiple caching methods and provides caching support for services at different levels. Browser-side caching is supported at the browser level, and Web request caching is provided at the service level. In addition, caching support is also provided at the service components level and the provider level. The details are as follows.

Component layer cache type supported by each service

  Cache types supported by map services Cache types supported by data services

File cache

SMTiles, GDPmap tiles (obsolete), UTFGrid property tiles (obsolete)

-

Database cache

MongoDBmap tiles、MongoDB(MVT)vector tiles

-

Memory cache

-

ehcache

Provider layer cache type supported by each service

  Cache types supported by map services Cache types supported by 3D services Cache types supported by image services

File type cache

UGCV5

Vector,Image,Terrain,Model,Map,Scene Cache

UGCV5 (original and compact)

Database type cache

-

-

MongoDB

 

2. Main functions and applicable scenarios of cache

2.1 The role of caching

The role of the cache is reflected in two aspects, one is to speed up the service through the cache file, and the other is to publish the cache directly as a data source.

Service acceleration through caching

Accelerating services through caching refers to pre storing service data, images, response results, etc. in a specific way, so that the server does not need to regenerate them when receiving the same request in the future, thereby improving data access efficiency. For example, if a map service generates a map cache file in advance, the server no longer needs to regenerate images when browsing the map, but directly returns cached tiles, effectively reducing computation and improving the mapping efficiency of the map service.

Publish the cache directly as a data source

Some cached data, such as map tiles, can also be published directly as a data source, and the map cache published map name service can also improve access efficiency. The map cache release process is as follows:

2.2 Applicable scenarios of caching

Browser-side caching, Web request caching, component-layer caching, and provider-layer caching are applicable to different scenarios:

3. Cache enabling process

Browser-side cache enabling process

Browser-side caching is generally enabled by default and does not need to be set separately.

Web request cache enabling process

The way to enable the Web request cache is to start the iServer, enter the Service > Advanced-> HTTP Cache page, and set enable HTTP cache.

Component layer cache enabling process

Component layer file cache activation method (to enable SMTiles as an example)

Component layer database cache activation method (take enabling MongoDB as an example)

Component level memory caching (ehcache) is enabled by default and does not require separate configuration.

Provider layer cache enablement process

Provider-level file cache activation method

The map services file-based cache activation method (using UGCV5 as an example):

3D service file-based cache activation method:

The image services file-based cache activation method: Refer to Configuring the image services dynamic cache scheme .

Provider tier database cache activation method

The image services database-type cache activation method: Refer to Configuring the image services dynamic cache scheme .

4. Cache production and update

There are two modes of caching, dynamic generation and pre-caching. Browser-side cache and Web request cache only support dynamic cache, while component-level cache (except memory cache) and provider-level cache support both dynamic cache and pre-cache. For the component and provider layer cache, when the pre-cache exists, the pre-cached file is used first, and when the pre-cache does not exist, the cache is generated dynamically.

Browser-side cache production and update

When the service is accessed, the browser-side cache is dynamically generated and stored in the browser memory, and when the same request is received, the cache result is directly returned. After the browser-side cache expires, the cache is regenerated when the request is received again.

Web request cached production and update

When the service is accessed, the service response result cache is dynamically generated in the ehcache, and when the same request is received, the cache result is directly returned. After the Web request cache expires, the cache is regenerated when the request is received again.

Component layer cache production and update

The production mode of component layer cache is shown in the following table:

Service Type The cache type supported by various services Cache production mode
Dynamically generated Pre-cache
Map Services File cache SMTiles map tiles, GDPmap tiles (obsolete), UTFGrid property tiles (obsolete) Generate a cache dynamically when plotting through map services Generated by iServer Distributed Graph Cutting Service
Database cache MongoDBmap tiles Generated by iServer distributed cutting service or iDesktop cutting function
MongoDB(MVT)vector tiles -
Data Services Memory cache ehcache Generate cache dynamically when data services are accessed -

Cache generation mode

Map services

The component-layer cache of map services supports two cache generation methods: dynamic generation and pre-caching. Dynamic caching is the dynamic generation of a cache while accessing a service. The pre-cache is to generate the cache in advance. When accessing the service, the generated cache file can be used directly, and the cache will not be generated dynamically.

Note: The grid tiles generated by the iDesktop graph cutting function can be used as the pre-cache of iServermap services, but the vector tiles generated by the iDesktop graph cutting function cannot be used as the pre-cache of iServermap services

Data services

After enabling the component layer cache, data services stores the dynamically generated cache in ehcache when accessing data services.

Cache update method

Map services

The amount of data in map services is usually large, so it is generally recommended that you update the cache through the pre-cache feature. You can update the cache through the iServer Distributed Graph Cutting Service or the iDesktop Graph Cutting feature in the same way that you generate the cache. When updating, you can choose to update the whole or part of it. Take the iServer distributed graph cutting service as an example to introduce:

Data services

The lifetime of the data component layer memory cache is one minute. If the same request is not received within one minute, the cache is automatically invalidated. After the existing cache is invalidated, the cache is regenerated when a request is received.

Production and update of provider layer caches

Service Type Cache Type Generation Mode
Dynamic cache Pre-cache
Map Services File type cache UGCV5 Generate a cache dynamically when plotting through map services Generated by iServer distributed cutting service or iDesktop cutting function
3D Service File type cache Vector, Image, Terrain, Model, Map, Scene Cache - Generated by the iDesktop Generate Scene Cache feature
Image Services File type cache UGCV5 (original and compact) Generate a cache dynamically when plotting through image services Silent slice generation with iServerimage services
Database type cache MongoDB

Cache generation mode

Map Services

3D Service

The provider layer does not support the dynamic generation of cache for 3D services, and only supports pre-caching. The pre-caching method is as follows:

Generate image cache, terrain cache, vector cache, 2D/3D map cache or 3D scene cache through the iDesktop "Generate Scene Cache" function. Please refer to the specific steps. Build Scenario Cache in iDesktop Help. Note that if you want to accelerate 3D services through pre cached files, you need to copy the pre cached 3D cache files to the 【SuperMap iServer installation directory】\webapps\isurver\output\{scene} directory after generating the pre cache.

Image Services

Cache update method

The data volume of map services, 3D services, and image services is usually large, so it is generally recommended that you update the cache through the pre-cache function in the same way as you generate the cache. When updating the cache through the pre-cache function, you can also update the whole or part of the cache according to your needs.

5. How to select a cache

iServer provides caching support for map services, data services, 3D services, and image services. The caching methods supported by these services are shown in the following table:

Table Cache modes supported by iServerdata services, map services and 3D services

  Data Services Map Services 3D Service Image Services
Support the enabled cache mode Browser-side caching, component-layer caching Browser-side caching, Web request caching, component-layer caching, provider-layer caching Browser-side caching, Web request caching, provider-layer caching Browser-side cache, provider-layer cache

5.1 Map services cache selection policy

How should map services select a cache in a stand-alone environment?

In a stand-alone environment, the map services can turn on Web request caching.

In addition, if the data update frequency is low , it is recommended to open the map cache at the same time. The specific recommendations are as follows:

When map caching is enabled, you can choose to use dynamic caching or pre-caching. When the amount of data is very large, it is recommended that you use the pre-cache method, which can effectively improve the efficiency of plotting.

How should map services select a cache in a multi-machine environment?

The multi-machine environment includes a cluster environment and a database-based multi-node service configuration information automatic synchronization environment. In a multi-machine environment, the map services can turn on Web request caching.

In addition, SuperMap workspace, SuperMap rest map service, OGCmap services, online map services, ArcGIS, REST map services published map name service. If the data change frequency is low , it is recommended to enable the MongoDB map cache at the same time.

5.2 Data services cache selection policy

For data services, iServer enables component-level memory caching and browser-side caching by default. You do not need to make a selection or perform additional startup configuration.

5.3 3D service cache selection policy

Web request caching can be turned on for 3D service.

In addition, for the 3D service published by SuperMapworkspace, if the frequency of data source change is low, it is recommended to enable 3D pre-caching.

5.4 Image services cache selection policy

For image services, it is recommended to use UGCV5 cache in stand-alone environment and MongoDB cache in multi-machine environment.