a better approach to cache flushing; so we only really do it when things really change