Core: Improved cache handling

Signed-off-by: Elliot Condon <e@elliotcondon.com>