Updated old cache function