rim:cache element

Syntax

<rim:cache disableAllCache=["true" | "false"]
           aggressiveCacheAge="time"
           maxCacheSizeTotal="size" 
           maxCacheSizeItem ="size" />

Description

The <rim:cache> element specifies the limits for caching BlackBerry WebWorks app content. This element is optional.

Parent elements

<widget>

Child elements

None

Occurrences

Zero or one

Attributes

You can use the following attributes in this element:

Attribute Description
disableAllCache

The disableAllCache attribute specifies whether caching is disabled for the app. This attribute must contain a Boolean value.

By default, if you do not specify this attribute, caching is enabled.

This attribute is optional.

aggressiveCacheAge

The aggressiveCacheAge attribute specifies the amount of time, in seconds, to cache items that are not governed by directives in the HTTP header.

By default, if you do not specify this attribute, these items are kept for 2592000 seconds (30 days). Settings higher than this value are ignored.

This attribute is optional.

maxCacheSizeTotal

The maxCacheSizeTotal attribute specifies the maximum amount of storage space, in kilobytes, to use for the cache.

By default, 1024 kilobytes of storage space is allocated for the cache. The maximum value is 2048 kilobytes.

This attribute is optional.

maxCacheSizeItem

The maxCacheSizeItem attribute specifies the maximum amount of storage space, in kilobytes, for individual items that can be cached.

By default, items up to 128 kilobytes are cached. The maximum cache size is the value set for the maxCacheSizeTotal attribute.

This attribute is optional.

Example: Specifying the maximum cache size for the app and individual items

<rim:cache maxCacheSizeTotal="2048" maxCacheSizeItem ="256" />

Last modified: 2013-10-02