Add primitive caching support for better performance when not doing a
sandbox demo.