Show TOC

 Client-Side Caching of Static ObjectsLocate this document in the navigation structure

Use

You can use the client cache service to cache static resources such as graphics or style sheets in the browser cache of the client PC.

Client-side caching reduces the amount of requests sent to the portal server because static resources that have already been called once can be loaded directly from the browser cache of the user if further requests occur. This reduces the portal server load.

Prerequisites
  • You activated the client cache service
  • The user set the settings for temporary Internet files to 'Automatically' in his or her browser so that the system is able to support client-side caching.
Features

The client cache service analyzes client cache patterns that you created in KM Configuration. In a client cache pattern, you specify the KM folder whose resources are to be kept in the browser cache of the client PC for the defined time after the first call.

When a user calls these resources in the portal for the first time, the system sends the lifetime of the resource called in the HTTP header of the portal response. If the user requests the same resource within the lifetime specified, the system loads the resource in question directly from the browser cache of the user.

If the configured lifetime has expired, the system loads the resource from the portal again and restarts the lifetime of the resource in the browser cache.

If a user modifies a resource in KM during its lifetime, the cached version is considered obsolete, and the browser retrieves the new version from the server as soon as the user calls the resource. The system restarts the lifetime of the resource in the browser cache. If a user deletes a resource, the cache is invalidated.

Client Cache Patterns

In client cache patterns, you define the folders and/or MIME types for which client-side caching is to be used.

Parameters of Client Cache Patterns

Parameter Required Description

Path Prefix

Yes

Path to a KM folder whose resources you want to cache

Example: /repository/path

Client-side caching is supported for all resources in the specified path and in all subfolders.

You can restrict caching to certain MIME types (see the MIME Types parameter).

If client cache patterns exist for subfolders of a folder that already has its own client cache pattern, the system gives the client cache patterns of the subfolders higher priority and analyzes them first.

MIME Types

No

Comma-separated list of MIME types to be cached

You can make entries in complete or shortened form.

Example: image or image/gif

Cache Timeout

Yes

Specifies the lifetime of resources in the browser cache in seconds.

The client detects changes made to resources between the point when they enter the browser cache and the point when they expire, and the cache is invalidated. After the client has retrieved the modified resource, the system restarts the lifetime of the resource in the browser cache.

If you change the value for this parameter, the new value only takes affect after the previous lifetime has expired unless you manually delete the browser cache on the client and reload the resource in question.

Read Only

No

If this parameter is selected, only read-only objects are cached on the client.

 

If there are multiple client cache patterns, the system determines the priority as follows:

Priority 1: Path Prefix

Priority 2: Mime Types

Priority 3: Read Only

The more specific the specifications in a client cache pattern, the higher its priority in comparison with other client cache patterns.

Activities

The client cache service, which is required for client-side caching, is activated by default. This service is found in the portal at System Administration → System Configuration → Knowledge Management → Content Management → Global Services → Client Cache Service. No further configuration is necessary or possible for this service.

You have to create client cache patterns for folders whose resources are to be cached on the client. Client cache patterns are found in the portal at System Administration → System Configuration → Knowledge Management → Content Management → Global Services → Client Cache Patterns.

 

Caution

Only create cache patterns for folders containing images, stylesheet files, or resources with a known lifetime.

Do not create cache patterns for folders containing documents that are changed on a regular basis. If you do so, you risk users seeing old versions of the document instead of the most up-to-date version.

You can configure certain MIME resources to be cached forever in the Web browser without losing the flexibility to change the resources on the server side. To enable this feature, set the Cache Timeout value of the relevant client cache pattern to -1.

Caution

Set the Cache Timeout value to -1 for KM resources only. It is required that the code of the application that generates the HTML file containing links to the affected MIME resources uses the KM service URL Generator Service to generate URLs. Thus, the feature is supported for KM resources only.