And we gave a brief recap of caching at the beginning of February's Performance column. The second principle is called spacial locality and depends on using things at the same time that are located near each other. A cache works well if there are a lot more reads than writes, and the reads or writes of the same or nearby data occur close together in time. A special kind of cache can be used to accelerate writes. Write caches use the same principles of temporal and spacial locality in a slightly different way.
Temporal locality applies when writes to the same thing happen close together in time.
Writes that have spacial locality allow adjacent writes to be coalesced into a single larger write that is much more efficient to process. Here's how NFS access caching works We'll start by looking at the simplest configuration, the open, fstat, read, write , and mmap operations on an NFS mounted filesystem. Like the UFS inode cache, the rnode keeps pointers to pages from the file that are in the local page cache. The handle has no meaning on the client, but on the server it is used to locate the mount point and inode number of the file so that NFS reads and writes can go directly to the right file on the server. If the file is not found, it causes a DNLC lookup on the server that sets up both the DNLC entry and the rnode entry on the client.