Create cache records and relations