hxt-cache-0.0.4: Cache for HXT XML Documents and other binary data

Portabilityportable
Stabilityexperimental
MaintainerUwe Schmidt (uwe@fh-wedel.de)

Text.XML.HXT.Arrow.XmlCache

Description

Caching of XML document trees and other binary data

Synopsis

Documentation

readDocument :: Attributes -> String -> IOStateArrow s b XmlTreeSource

This readDocument is a wrapper for the Text.XML.HXT.Arrow.ReadDocument.readDocument function. The function is controlled by the options a_cache, a_compress and a_document_age.

  • a_cache: the document tree of the document read is cached in the directory given by this option, or, if it is read before and it is not out of date, see a_document_age, it is read from the cache. The document is stored in binary format (used package: binary).
  • a_compress : controls whether the cache contents is compressed with the bzip2 lib for saving space
  • a_document_age: determines the maximum age of the document in seconds. If this time is exceeded, the cache entry is ignored, the original is re-read and cached again. Default for the document age is 1 day.

sha1HashValue :: (Arrow a, Binary b) => a b IntegerSource

Compute the SHA1 hash is hexadecimal format for an arbitray serializable value

data CacheConfig Source

Constructors

CC 

isInCache :: Attributes -> IOStateArrow s String ClockTimeSource

Arrow for checking if a document is in the cache. The arrow fails if document not there, else the file modification time is returned.