ssg: HttpRequestHelper: never cache http requests

This commit is contained in:
Nick Vella 2019-07-22 02:08:05 +10:00
parent b8def8bbb7
commit 4e35f56a55
1 changed files with 2 additions and 2 deletions

View File

@ -120,7 +120,6 @@ namespace OpenLiveWriter.CoreServices
try
{
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
//hack: For some reason, disabling auto-redirects also disables throwing WebExceptions for 300 status codes,
//so if we detect a non-2xx error code here, throw a web exception.
int statusCode = (int)response.StatusCode;
@ -281,7 +280,8 @@ namespace OpenLiveWriter.CoreServices
//Warning: NTLM authentication requires keep-alive, so without adjusting this, NTLM-secured requests will always fail.
request.KeepAlive = false;
request.Pipelined = false;
request.CachePolicy = new RequestCachePolicy(RequestCacheLevel.Reload);
// Bypass cache entirely - some blogs, specifically static blogs on GH pages, have very aggressive caching policies
request.CachePolicy = new RequestCachePolicy(RequestCacheLevel.BypassCache);
return request;
}