Various cache improvements