Skip to main content
Skip table of contents

Configure Least Recently Used Memory Cache - SuperWEB2

To use the Least Recently Used Memory Cache strategy with SuperWEB2 you need to configure the following parameters in the web.xml configuration file. This file is located in <tomcat_home>\webapps\webapi\WEB-INF\

ParameterConfiguresAvailable OptionsDefault
lruMapSize

The size of the in-memory Least Recently Used map for storing table query results.

Any integer (indicates the number of stored table queries)

30

systemTableCacheStrategy

The cache strategy for system defined tables stored in webapi\WEB-INF\resources\txd.

  • CouchBaseMemoryPersistentCache
  • LRUMemoryCache
  • NoCache
NoCache
otherTableCacheStrategyThe cache strategy for non-system defined tables.
  • CouchBaseMemoryPersistentCache
  • LRUMemoryCache
  • NoCache
NoCache

To configure Least Recently Used Memory caching:

  1. Open web.xml in a text editor.

    Make a backup copy of this file before making any changes.

  2. Search for the Query Caching section:

    CODE
    <!-- Query Caching Configuration  -->
        <!-- 0 means never expire -->
        <context-param>
        	<description>MemCached Server Cache Expiration Period</description>
        	<param-name>memCachedServerExpiration</param-name>
        	<param-value>0</param-value>
        </context-param>
        <context-param>
        	<description>MemCached Server URL</description>
        	<param-name>memCachedServerURL</param-name>
        	<param-value>http://localhost:8091/pools</param-value>
        </context-param>
        <context-param>
        	<description>In-memory cache LRUMap size</description>
        	<param-name>lruMapSize</param-name>
        	<param-value>30</param-value>
        </context-param>
        <!-- Available cache strategy options: 
        	CouchBaseMemoryPersistentCache - Couchbase MemCached persistent cache would be used.
        					 Required params: memCachedServerExpiration, memCachedServerURL, lruMapSize
        	LRUMemoryCache - In-memory LRU cache would be used.
        		 	 Required params: lruMapSize
        	NoCache - No caching would be used.
        -->
        <context-param>
        	<description>System Table Cache Strategy</description>
        	<param-name>systemTableCacheStrategy</param-name>
        	<param-value>NoCache</param-value>
        </context-param>    
        <context-param>
        	<description>Cache Strategy for rest of tables</description>
        	<param-name>otherTableCacheStrategy</param-name>
        	<param-value>NoCache</param-value>
        </context-param>
  3. Set lruMapSize to the number of table query results you want to cache in memory.

  4. Set systemTableCacheStrategy to LRUMemoryCache if you want to use LRUMemoryCache for predefined system tables.
  5. Set otherTableCacheStrategy to LRUMemoryCache if you want to use LRUMemoryCache for other tables.

If you set both systemTableCacheStrategy and otherTableCacheStrategy to use LRUMemoryCache, then they share the map size indicated in lruMapSize.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.