Skip to content

Stop continuously creating SourceCacheContext in PM UI scenarios #12859

@nkolev92

Description

@nkolev92

The purpose of source cache context is to tell a source where and for how long to cache certain files.

Restore ensures that the caching is shared across the whole operation through https://github.com/NuGet/NuGet.Client/blob/dev/src/NuGet.Core/NuGet.Commands/RestoreCommand/RestoreCommandProviders.cs#L86.

Unfortunately that pattern is not applied everywhere.

This leads to needless allocations and could potentially make things more difficult should we want to change the cache time.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Priority:2Issues for the current backlog.Product:VS.ClientType:Engineeringproduct/infrastructure work/not a customer bug/feature/DCR

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions