Add hasResource method to check if a resource exists in the cache.
Speed up cache loading using some concurrent queries.
fix #5