added code for node-based caching instead of tile-based