optimize set background logic
optimize cache background and local background logic