Add local variable caching to example.