brew can cache parsed templates for potential speedup but only when brew
calls are passed filenames, not connections, and when tplParser
is NULL.
brew caching is implemented by storing file names, modification
times, and the associated text and R expressions in an internal
environment. Calling brewCache()
with an appropriate
environment sets the internal cache. Calling without arguments
returns the internal cache. The cache is exposed this way mainly
for testing, debugging, performance improvement, etc. and this
may be off-limits in future releases.
Simple enough, brewCacheOn()
turns on
caching of brew templates and is equivalent to calling
brewCache(envir=new.env(hash=TRUE,parent=globalenv()))
.
brewCache()
without arguments returns the internal
environment. Calling brewCacheOff()
turns off caching by
setting the internal environment to NULL
.
One thing to note: filenames act as keys in the internal cache
environment, and brew does nothing to expand them to their full
paths. Thus, '/home/user/brew.html' and '~usr/brew.html' will
act as separate keys, although on-disk they may actually point
to the same file.
setBufLen()
initializes internal parsing vectors to length len
. Default is 0.