Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add cache expiration for HttpCache entries. #440

Merged
merged 1 commit into from
Jul 25, 2023

Conversation

morended
Copy link
Contributor

  1. Set cache entry size to the content length of the http response received.
  2. Set cache expiration for a cache entry.
  3. Set different cache keys for jsonDoc cache entry and http string response cache entry

@pmalmsten
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

MemoryCacheEntryOptions mce = new() { Size = contentLength };
MemoryCacheEntryOptions mce = new() {
Size = contentLength,
AbsoluteExpirationRelativeToNow = TimeSpan.FromMinutes(30),
Copy link
Member

Choose a reason for hiding this comment

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

nit: do we want to make this configurable?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The reason we set it to 30 minutes is the OSSGadget code is executed by exe tools whose run time is low. Hence 30 minutes should be sufficient. But we taken totally make it configurable if needed in future.

@jpinz jpinz merged commit 91d04c0 into microsoft:main Jul 25, 2023
5 checks passed
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.

3 participants