#### Cache tab

This Cache tab allows you to configure the cache settings of JReport Enterprise Server. It contains three sub tabs:

- Report Cache
- Security Cache
- Image Cache

Save

Applies the changes to JReport Enterprise Server.

##### Report Cache

To improve performance, JReport Enterprise Server enables you to cache report sets and catalogs into memory so that they do not have to be loaded from disk when they are required. Note that when you run a report set to DHTML format, the report set and the catalog will not be cached.

The following options are available in the tab. See the tab.

Cache Loaded Catalogs

Specifies whether to keep a catalog in memory or to remove it from memory after a report set has been generated.

Usually, after a report set has been generated, the catalog used to generate it is removed from memory. However, if you specify this option, the catalog will be cached instead of being removed.

- Maximum Number of Catalogs to be Cached
  Specifies the maximum number of catalogs that can be cached by the server in its memory. No more catalogs can be cached if this amount has been reached.
- Cached Catalogs
  Lists the currently cached catalogs.

  If you are using the Add button to add a catalog, the listed catalog item includes information such as catalog file path in the server resource tree and catalog version number. The format is as follows:<catalog file path>-V<version number>. The root path stand for the My Reports folder is `/USERFOLDERPATH/admin/`; the root path stand for the Public Reports folder is `/`.

  For the catalogs that are automatically cached by the server after the report sets in them are run, the real paths of them are listed.

  - Add
    Adds a new catalog to the list of catalogs to be cached.
  - Remove
    Deletes the selected cached catalog.

Cache Loaded Report Sets

Specifies whether to keep the report sets in memory or to remove them from memory after they have been generated.

- Maximum Number of Report Sets to be Cached
  Specify the maximum number of report sets that can be cached in the memory by the server. No more report sets can be cached if this amount has been reached.

  Each cached report set will use some heap memory. If the heap is used up, an OutOfMemoryException will be thrown. -ms/-Xms specifies the initial heap and -mx/-Xmx specifies the maximum heap. For example, -ms10m -mx512m means that the initial heap is 10MB and the maximum heap is 512MB. You can refer to the documents of the Java VM for more information.

  Here is an example, the accuracy depends on your OS and VM:

  Cache Size | Heap Size Required
  --- | ---
  10 report sets | 16M
  30 report sets | 25M

  The default cache size is 10 report sets and the default maximum heap space is 512MB. When you adjust the number, you should adjust the heap accordingly. The larger the heap space, the better the performance provided enough physical memory is available.

- Cached Report Sets
  Lists currently cached report sets.

  If you are using the Add button to add a report set, the listed report set item includes information such as report set file path in the server resource tree, report set version number, and applied style name. The format is as follows: <report set file path>-V<version number>(<applied style name>). When there is no style applied, the applied style name is None. The root path stand for the My Reports folder is `/USERFOLDERPATH/admin/`; the root path stand for the Public Reports folder is `/`.

  For the report sets that are automatically cached by the server after they are run, the real paths of them are listed.

  - Add
    Adds new report sets to the list to be cached.
  - Remove
    Deletes the selected cached report sets.

Report Buffer Size for Sort Action

- System Managed Size
  Specifies whether to automatically control the buffer size used in the RAM for each report when sorting on DHTML reports by system. If checked, all data for sorting will be stored in the RAM automatically.
- Custom Size
  Specifies to customize the buffer size used in the RAM for each report when sorting on DHTML reports. The default value is 16 MB, and the minimum size required by JReport is 4 MB. Any value smaller than 4 MB will be ignored and use 4 MB instead, because if the amount of data for sorting is large (such as 5,000,000 records), but the buffer size that you configure is small, it will require a lot of IO and produce poor performance.

Note: Any change to the buffer size will take effect immediately.

##### Security Cache

The following options are available in the tab. See the tab.

User Cache Size

Specifies the maximum number of user objects in the security cache.

Role Cache Size

Specifies the maximum number of role objects in the security cache.

Group Cache Size

Specifies the maximum number of group objects in the security cache.

Protection Cache Size

Specifies the maximum number of ACL objects in the security cache.

##### Image Cache

The following options are available in tab. See the tab.

Cache Images

Specifies whether or not to enable image cache.

- All used images
  If checked, all the images that are used in reports will be cached.
- Maximum Image Cache Size
  If checked, specify the maximum size for caching images as required. The default value is 10 MB.
- Show Details
  If checked, the detailed status of the current image cache will be shown, that is to say, you can see all the cached images.
  - Name
    Displays the name of the image.
  - Size
    Displays the size of the image file.
  - Catalog
    Displays the catalog file in which the image file is.
  - Path
    Displays the path of the cached image.
  - Locked
    Displays the lock status of the image file.
  - Add
    Adds an image to the image cache.
    - Look In
      Specifies the root of the catalog, My Reports or Public Reports.
    - Select Directory
      Specifies the directory of the catalog.
    - Catalog
      Specifies the catalog from the drop-down list.
    - Image File
      Specifies the image file.
    - Image Size
      Displays the size of the selected image file.
  - Lock
    If you select one image and lock it, the image will be always kept in cache until you remove it manually or restart JReport Enterprise Server.
  - Unlock
    The unlocked image will not be always be kept in cache.
  - Remove
    Removes the selected image from the image cache.
  - Remove All
    Removes all the images from the image cache.