Configuring the Cache

Customer's Canvas uses a cache to make users' work faster. It stores data that they have accessed recently. Original and edited images, images of text layers, proof images, and product templates are cached.

Caching is carried out in the following way. When a user edits a product, Customer's Canvas caches every design element and the product itself. Also, proof images and hi-res outputs are saved in the cache. When a cache size reaches the limit, then a cleanup process starts. The stored items are sorted by a timestamp. The older elements are, the sooner they are removed from the cache. The hi-res output and proofing URLs never expire, however. If a user wants to obtain a file that was removed from the cache, Customer's Canvas renders it again.

You can control the cache and the cleanup process by setting up cache parameters. They are defined in the Aurigma.GraphicsMill.AjaxControls.VectorObjects.FileCacheConfiguration section of web.config:

XML
<configuration>

    <configSections>
        <section name="Aurigma.GraphicsMill.AjaxControls.VectorObjects.FileCacheConfiguration" 
            type="System.Configuration.NameValueSectionHandler, System, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
    </configSections>

    <Aurigma.GraphicsMill.AjaxControls.VectorObjects.FileCacheConfiguration>
        ...
    </Aurigma.GraphicsMill.AjaxControls.VectorObjects.FileCacheConfiguration>

</configuration>

Configuring Cache Parameters

You can set up the cache size and its location. To control the cleanup process, you can set up an interval in seconds between cleanup runs or a cache size that triggers this process.

The following parameters configure the cache:

Name Description Default value Possible values
Cache
MaxSize the maximum size of the cache in bytes 10737418240 (10GB) number
CleanUpInterval interval between cleanup runs, in seconds 1800 (30 minutes) number
MaxUtilizationThreshold maximum cache utilization level (in percent) that triggers automatic cleanup; when the cache size reaches MaxUtilizationThreshold, the cleanup process starts 95 number
UtilizationTarget utilization level (in percent) to which the cache should be cleaned up; when the cleanup algorithm reaches the UtilizationTarget level, the cleanup process stops 70 number
RootPath the folder where the cache is stored ~/App_Data/FileCache folder path

For example, let us change the default parameters to run the cleanup once an hour or after reaching the 90 percent level.

XML
<configuration>

    <configSections>
        <section name="Aurigma.GraphicsMill.AjaxControls.VectorObjects.FileCacheConfiguration"
            type="System.Configuration.NameValueSectionHandler, System, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
    </configSections>

    <Aurigma.GraphicsMill.AjaxControls.VectorObjects.FileCacheConfiguration>
        <!-- 4 GB -->
        <add key="MaxSize" value="4294967296" />
        <!-- An hour -->
        <add key="CleanUpInterval" value="3600" />
        <!-- The 90 percent threshold -->
        <add key="MaxUtilizationThreshold" value="90" />
        <!-- The target level -->
        <add key="UtilizationTarget" value="70" />
        <!-- The cache folder -->
        <add key="RootPath" value="D:\FileCache" />
    </Aurigma.GraphicsMill.AjaxControls.VectorObjects.FileCacheConfiguration>

</configuration>

By setting the path to the RootPath parameter, you move the cache location to drive D.

Moving Data Folders to Another Location

By default, Customer's Canvas stores the file cache in the ~/App_Data/FileCache folder. You may want to change it using relative or absolute paths:

  • Relative paths to folders are specified based on your site root and start with ~/.
    <add key="RootPath" value="~/App_Data/FileCache" />
    
  • Complete absolute paths start with a drive letter.
    <add key="RootPath" value="D:\FileCache" />
    
  • Absolute paths start with \\ for network locations.
    <add key="RootPath" value="\\productserver\FileCache" />
    
Note

When you use absolute paths to external folders, make sure the user account, under which Customer's Canvas runs in ASP.NET/IIS, has the read/write access to the remote folders.

As well as for the cache folder, you can change locations of the public gallery folder, the font folder, and the folder containing user data, like templates and images. PublicGalleryFolder and UserDataFolder should be set up in the appSettings section of web.config, and FontDirectory is set up in the Aurigma.GraphicsMill.AjaxControls.VectorObjects section:

XML
<configuration>

    <appSettings>
        <!-- The public gallery folder -->
        <add key="PublicGalleryFolder" value="C:\PublicGalleryFolder"/>
        <!-- The folder containing user's templates and images -->
        <add key="UserDataFolder" value="C:\UserDataFolder"/>
    </appSettings>

    <Aurigma.GraphicsMill.AjaxControls.VectorObjects>
        <!-- The font folder -->
        <add key="FontDirectory" value="D:\Fonts" />
    </Aurigma.GraphicsMill.AjaxControls.VectorObjects>

</configuration>

See Also

Manual