handle cache modes properly