you would probably need to check ``if ($type != 'user')`` to avoid double invalidation