Appendix B. Caching

Grammar parsing can be time consuming, but after development is finished, they change infrequently. CoffeePot can automatically cache compiled versions of grammars and use them automatically if they are up-to-date (based on last modified time).

(You can do this manually, by saving the compiled grammars and loading them explicitly, but using a cache saves a little time and effort.)

The location of cached grammars is controlled by cache setting in the configuration file. If the cache is a relative location (such as .grammar-cache), the compiled grammars are stored in the cache with the same filename as the original grammar except that the extension is changed. If the location is absolute (begins with a "/"; such as /home/user/.config/nineml/grammar-cache), the name of the cached file is a cryptographic hash of the original absolute filename.

The cache directory must be configured; if it's unconfigured, no caching is performed.