optimized caching length