Fixed getContentTypeFields query and added improved caching