KEMBAR78
Cache information responses from REST sources by JohnMcPMS · Pull Request #5726 · microsoft/winget-cli · GitHub
Skip to content

Conversation

JohnMcPMS
Copy link
Member

@JohnMcPMS JohnMcPMS commented Sep 17, 2025

Change

Store and use the /information response from REST sources per their cache-control header.

At the base of this change is a new type of setting stream: Encrypted. These settings are encrypted to the user and machine that the data is stored on.

Based on the log file from running with and without a cached value, the time between close log lines dropped from 189 ms to 8 ms for the msstore source. This time saving should be in effect for the large majority of uses of WinGet.

Validation

Added tests across various levels of the change.
Manually verified functionality of CLI.

Microsoft Reviewers: Open in CodeFlow


bool IsValidNonEmptyStringValue(std::optional<std::wstring>& value)
{
if (Utility::IsEmptyOrWhitespace(value.value_or(L"")))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: return !Utility::IsEmptyOrWhitespace...

{
using namespace std::string_view_literals;
constexpr std::string_view s_DefaultTempDirectory = "WinGet"sv;
constexpr std::string_view s_SettingsFile_Relative = "Settings"sv;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: The s_SecureSettings_UserRelative below uses "settings", will that potentially cause conflicts in the future?

@JohnMcPMS JohnMcPMS merged commit ab887ef into microsoft:master Sep 25, 2025
9 checks passed
@JohnMcPMS JohnMcPMS deleted the cache-info branch September 25, 2025 18:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants