To achieve cache vary based on the Vary Cache settings, Perma-Cache uses a special directory and file structure. It was designed to be easily readable while providing the capabilities needed by the system to differentiate between different vary settings of each file. This article explains the structure of how the files are stored within a storage zone.
Root FolderBy default, the Perma-Cache can be stored in any storage zone and uses the folder: This folder is used by every pull zone that uses this storage zone for Perma-Cache. __bcdn_perma_cache__ |
Pull Zone FolderThe next branch in the directory tree is the Pull Zone directory: It consists of the Pull Zone name and a unique caching ID unique_id. Whenever a full zone cache purge is performed, the unique_id will increase and a new folder will be used for this zone. pullzone__<pullzone_name>__<unique_id> |
File PathNext is the directory path to the requested URL. This matches the normal request path, however, it has normalization applied to combine multiple slashes into a single slash (// into /). For example: path/to/my/file/ |
File NameNext is the directory with the name of the file enclosed in ___, for example: ___image.jpg___/ |
File and VariationsFinally, this brings us to the last folder of the structure which contains the actual files depending on the variation. When no Vary settings are used, the file is provided simply as: If the Vary cache settings are used, the variation is also appended as a MD5 hashed string or our internal caching keys. ___file___ |
Putting it all together
A full example structure would then end up such as:
/testfiles/__bcdn_perma_cache__/pullzone__permacachetest__20138242/path/to/my/file/___image.jpg___/___file___