Cache file system

You can use the Cache file system, or CacheFS, to enhance performance of remote file systems, like NFS, or slow devices such as CD-ROM.

When a remote file system is cached, the data read from the remote file system or CD-ROM is stored in a cache on the local system, thereby avoiding the use of the network and NFS server when the same data is accessed for the second time. CacheFS is designed as a layered file system which means that it provides the ability to cache one file system (the NFS file system, also called the back file system) on another (your local file system, also called the front file system), as shown in the following figure:

Figure 1. Cache File System (CacheFS). This illustration show a client machine and a server that are connected by a network. The storage media on the server contains the back file system. The storage media on the client contains the cached file system or the front file system.
Cache File System (CacheFS)

CacheFS functions as follows:

  1. After creating a CacheFS file system on a client system, you can specify which file systems are to be mounted in the cache.
  2. When a user on the client attempts to access files that are part of the back file system, those files are placed in the cache. The cache does not get filled until a user requests access to a file or files. Therefore, the initial request to access a file will be at typical NFS speeds, but subsequent accesses to the same file will be at local JFS speeds.
  3. To ensure that the cached directories and files are kept up to date, CacheFS periodically checks the consistency of files stored in the cache. It does this by comparing the current modification time to the previous modification time.
  4. If the modification times are different, all data and attributes for the directory or file are purged from the cache, and new data and attributes are retrieved from the back file system.

An example of where CacheFS is suitable is in a CAD environment where master copies of drawing components can be held on the server and cached copies on the client workstation when in use.

CacheFS does not allow reads and writes on files that are 2 GB or larger in size.