| Constructor and Description |
|---|
SoyTofuOptions() |
| Modifier and Type | Method and Description |
|---|---|
SoyTofuOptions |
clone() |
void |
setUseCaching(boolean useCaching)
Sets whether the resulting SoyTofu instance should cache intermediate results after
substitutions from the SoyMsgBundle and the SoyCssRenamingMap.
|
boolean |
useCaching()
Returns whether the resulting SoyTofu instance should cache intermediate results after
substitutions from the SoyMsgBundle and the SoyCssRenamingMap.
|
public void setUseCaching(boolean useCaching)
Specifically, if this param is set to true, then
(a) The first time the SoyTofu is used with a new combination of SoyMsgBundle and
SoyCssRenamingMap, the render will be slower. (Note that this first-render slowness can
be eliminated by calling the method SoyTofu.addToCache(com.google.template.soy.msgs.SoyMsgBundle, com.google.template.soy.shared.SoyCssRenamingMap) to prime the cache.)
(b) The subsequent times the SoyTofu is used with an already-seen combination of
SoyMsgBundle and SoyCssRenamingMap, the render will be faster.
The cache will use memory proportional to the number of distinct combinations of
SoyMsgBundle and SoyCssRenamingMap your app uses (note most apps have at most one
SoyCssRenamingMap). If you find memory usage to be a problem, you can manually control the
contents of the cache. See SoyTofu.Renderer.setDontAddToCache(boolean) for details.
useCaching - The value to set.public boolean useCaching()
public SoyTofuOptions clone()