-
Notifications
You must be signed in to change notification settings - Fork 69
Closed
Labels
In-PRIssues that have a PR open for them.Issues that have a PR open for them.needs author feedbackThe author of this issue needs to respond in order for us to continue investigating this issue.The author of this issue needs to respond in order for us to continue investigating this issue.
Description
Summary
HttpCachePolicy and HttpResponse.Cache are missing in .NetCore. I want to ask if there are equivalents and if there is plan to add them to adapter.
Motivation and goals
We need migrate code (an API in Sharepoint) to ASP.NetCore and we find that the APIs are not supported by ASP.NetCore.
In scope
- HttpCachePolicy.SetLastModified
- HttpCachePolicy.SetMaxAge
- HttpCachePolicy.SetOmitVaryStar
- HttpCachePolicyBase.VaryByHeaders
- HttpCacheVaryByHeaders.Item
- HttpResponse.Cache
Examples
- ServerAndPrivate cache settings
// cache settings: do not cache in the client, cache in the server. Give client timestamp.
HttpCachePolicy cache = context.Response.Cache
cache.SetCacheability(HttpCacheability.ServerAndPrivate);
cache.SetLastModified(context.Timestamp);
cache.SetExpires(context.Timestamp.AddDays(-1));
cache.SetMaxAge(TimeSpan.FromSeconds(0));
cache.SetOmitVaryStar(true);- set VaryByHeaders
httpContext.Response.Cache.VaryByHeaders["Origin"] = true;Metadata
Metadata
Assignees
Labels
In-PRIssues that have a PR open for them.Issues that have a PR open for them.needs author feedbackThe author of this issue needs to respond in order for us to continue investigating this issue.The author of this issue needs to respond in order for us to continue investigating this issue.