How to enable response caching with HttpWebRequest on .NET Core
问题 This is a follow up to this question regarding caching responses to an HttpWebRequest . I have a WebApi server that returns a JSON response with an Expires header that indicates how long the response should be cached locally on the client. I have written a .Net Standard 2.0 library with code to enable a default RequestCachePolicy as follows: var policy = new RequestCachePolicy(RequestCacheLevel.Default); HttpWebRequest.DefaultCachePolicy = policy; var request = WebRequest.Create(url); ... etc