Skip to content
pCon.configurator onlineDocumentation
Esc
↑↓navigate↵open⌘Jpreview
On this page

Global File Cache

The primary purpose of the global file cache is the reduction of the average time spent in the getGeneratedImage operation (§getGeneratedImage) of the basket service. To do so, this operation computes a hash over the 3D geometry of an OFML object and the rendering and camera settings as well as all other settings passed as options to the image generation operation. The hash is converted to a file name. If the cache contains a file with this name, the file is expected to contain the requested image1. If not, the image is generated and stored in the cache using the computed file name.

This algorithm has some advantages and drawbacks. It is quite simple and efficient, having nearly constant complexity, even for very large caches. On the other hand, all cached images become useless whenever there is a change to the aforementioned hash function2, while modifications to the rendering algorithm do not result in old images being invalidated3.

By default, the cache directory is var/cache within the Online Configurator’s installation directory. If the cache is to be stored somewhere else, var/cache may be replaced by a symbolic link to either an empty directory or a complete copy of an existing cache.

It is not allowed to share a cache between multiple instances of the Online Configurator.

The cache must not be modified by a program other than the Online Configurator. Individual files must not be deleted, nor copied into the cache (either from another cache or from a backup). The only allowed operations are deleting the entire cache (all files and sub-directories within var/cache, and optionally var/cache itself), and copying or restoration of the entire cache.

Contents

Footnotes

  1. In theory, the hash function (MD5) could compute the same hash for different article configurations and options. In practice, however, this is expected not to happen. ↩

  2. While this reduces the efficiency of the cache, other than that it should not be a problem as these image will be removed from the cache once it has reached it’s maximum size. ↩

  3. Thus, whenever a new version is installed which is known to have significant improvements to the image rendering algorithm, the entire cache should be deleted by hand. ↩