Added basic support for caching and span size