updated comment explaining uniform caching potential bottleneck
removed array casting, and added manual cache invalidation