When LAS creates a product it writes the files that make up the product to a special directory which is visible to the outside via the Tomcat server. This is how the browser loads the results of a product request into the browser for the user to see. When the product is created, LAS makes an entry into an internal cache data structure. When a new request comes in, LAS first consults the cache to see if the product already exists and if it does, it uses immediately returns the result to the client making the request and the client can pick up the results from the output directory.
The cache is managed internally using Least Recently Used algorithm with limits on both the number of files in the cache and the total size of the cache. The $LAS_HOME/conf/server/productserver.xml file is consulted when LAS starts to determine the size of the cache. The cache object is defined by this entry:
<cache size="1500" bytes="1024Mb" file="/home/tomcat/webapps/baker/output/cache.obj"/>
where size is the maximum number of files allowed in the cache. The bytes attributes is the total number of bytes allowed in the cache and the file attribute is where the cache entries are saved when the server is shutdown. The bytes attribute can be in Bytes (bytes=2000000) or MegaBytes (bytes=1024Mb) if the "Mb" abbreviation is included in the attribute value. When actions are performed on the cache it checks to see if 75% of the total number of bytes or total number of files limit has been reached. If not, new objects can be added. Potentially these new objects will take the cache size over the 75% limit, but next time something is to be added older entries will be removed to make room. This will allow the cache to grow and shrink as needed, but will virtually guarantee that it never grows bigger than the configured limits. If a new object is about to be added, and the cache is at its limit, the oldest cache entry will be removed until there is room for the new object.
The cache will be maintained across stops and starts. When LAS starts it reads the contents of the output directory and loads the internal cache object with what it finds in the directory subject to the rules above about the size of the cache.
The CacheManager Interface
After you have enabled access to the admin pages by following these instructions, browse to http://yourserver/las/CacheManager.do to see the contents of the cache along with a summary of the number of files and the total size of the cache. From this page you can clean the entire cache using the button at the top, or you can remove the files associated with a particular data set by selecting the button under where the files for that data set are listed.
Automatic Cache Cleaning (available starting with LAS v8.1)
If the above cache management is not adequate, there are features in LAS that will allow more specific control of the contents of the cache. In your las.xml configuration you can add the following properties to your configuration.
[ .... Other properties ... ]
The first property specifies how often the process that cleans the cache will run. It is expressed as a number of periods specified by the clean_units parameter. The clean_units parameter should be either "hours" or "days". The clean_age parameter (also expresses as a value in the specified units) is how old a file must be before it is removed. And finally, you can specify what time of day the process will start running.
The example given hear will run the cache cleaning process once a day. The process will run at one minute after midnight and it will remove any files from the cache that are more than 7 days old.