Contents

How does the caching work in Swiff Chart Generator?
When to use the caching?
The caching parameters
How to enable the caching on Windows?
How to enable the caching on UNIX?
The caching API
Examples
The Swiff Chart Generator Control Panel


How does the caching work in Swiff Chart Generator?

Swiff Chart Generator has a built-in caching support.

When caching is enabled, Swiff Chart Generator stores the data, the layout parameters as well as the corresponding generated chart data in a cache directory on the hard disk.

Each time a client requests the same chart (same data series, same chart style and parameters), the server simply sends back the previously generated Flash movie or image without having to re-generate it, thus considerably improving the performance. Once a chart is stored in the cache, the server does not consume CPU for movie or image regeneration.

The cache is automatically managed by Swiff Chart Generator so that it never allocates more than the maximum amount of disk memory specified by the configuration.



When to use the caching?

If tha data being graphed is often the same, using the cache is recommended. Enabling the cache is such cases will highly improve the performance. On the contrary, if the data being graphed is never, or rarely the same, using the cache is not recommended.



The Caching parameters

In Swiff Chart Generator, the caching has 3 different parameters:



How to enable the caching on Windows?

There are 2 methods to activate the caching in Swiff Chart Generator on Windows:



How to enable the caching on UNIX?

There are 2 methods to activate the caching in Swiff Chart Generator on UNIX systems:



The Caching API

The list below enumerates all the methods provided to manage the cache in your source code:

Method Definition
UseCache Enables or disables the caching system.
SetMaxCacheSize If caching is enabled, specifies the maximum size of the cache in KB.
SetCacheName If caching is enabled, specifies the name of the public cache relative to the web server root.
SetPrivateCacheDir If caching is enabled, specifies the path of the private cache directory. This path is absolute, it is not relative to the web server. (optional)
ClearCache If caching is enabled, this method forces the cache to be cleared.

IMPORTANT: Among the various methods provided by Swiff Chart Generator to generate a chart, some of them do not use the cache by default, others always require the use of the cache. The table below gives you the list of all the methods available to generate a chart and specifies for each of them if the cache is automatically used by Swiff Chart Generator or not.

Note: if you call a method which does not require the cache and if, in the same time, you want Swiff Chart Generator to use the cache for better performances, you must call the method UseCache to enable the cache or select Force cache in the Control Panel.


MethodAlways Uses cache
GetHTMLTag
X
GetOutputLocation
X
ExportAsResponse 
ExportAsFile 
ExportAsBinary 


Examples.




The Swiff Chart Generator Control Panel

The Swiff Chart Generator Control Panel enables you to fully configure the caching system. You can set all the required pathnames, the cache size as well as enable the cache for all the chart requests.

Read the Swiff Chart Control Panel page for a complete description of the dialog.