1.4.5. Cached Resources

Sometimes a HTTP server provides resources which are not actually real files but only a represenation of an internal state. In case such a resource does not change often you may use CachedResource. The data is accessed in a fashion similar to streams.

There is an extension of this caching class called FileResource. This class reads a file when creating the cache object and writes the potentially changed data back to the file when the object is destroyed.