Specifies the cache name if caching is used.

object.SetCacheName cache_name 


Required. A Chart object.
Required. A string that specifies the cache name.


If not defined in the Swiff Chart Generator Control Panel, the default cache name is "/charts_cache".

The cache name defines the location of the public cache on the web server.
The public cache directory stores the SWF, JPG, PNG, SVG and PDF files generated and returned by Swiff Chart Generator. This directory is defined as follows: <web_server_root>/<cache_name>.

This method overrides the Cache Name parameter value in the Swiff Chart Generator Control Panel as well as in the swfchart.ini configuration file

Important: for security reasons, web users should not be allowed to list this directory (otherwise they would be able to display any chart created on your server). You should therefore disable directory listing or put a default index file in it.


If the web server root is "C:\Inetpub\wwwroot", calling SetCacheName("/swf_cache") will set the public cache directory to "C:\Inetpub\wwwroot\swf_cache".
Cached files will then be written in this directory and their URL will be "/swf_cache/XXXXXXXX-XXXXXXXX.swf".

VBScript Sample Code

The following VBScript code illustrates use of the SetCacheName method.

'Create the chart series
chart.LoadStyle "C:\myStyle.scs"

'Set a custom cache name
chart.SetCacheName "/my_cache_name"

'The chart is complete, we can now generate the movie
Response.Write chart.GetHTMLTag

See Also

SetPrivateCacheDir Method | SetMaxCacheSize Method | ClearCache Method | UseCache Method

Applies To: Chart Object