Use cache for content type in type casting