Moved caching out of gui thread