prevent caching of livecheck

This commit is contained in:
tparnell
2018-11-02 07:23:10 -04:00
parent 07f7df9a85
commit 51ad78b54a
2 changed files with 9 additions and 3 deletions

View File

@@ -14,11 +14,15 @@ namespace aka.terribledev.io
public async static Task Run([TimerTrigger("0 */5 * * * *")]TimerInfo myTimer, ILogger log)
{
log.LogInformation($"C# Timer trigger function executed at: {DateTime.Now}");
var result = await client.GetAsync("https://aka.terribledev.io");
using (var result = await client.GetAsync("https://aka.terribledev.io", HttpCompletionOption.ResponseContentRead))
{
if (!result.IsSuccessStatusCode)
{
log.LogCritical("Error waking up redirect", result);
}
var content = await result.Content.ReadAsStringAsync();
log.LogInformation($"Recieved status code ${result.StatusCode} with body ${content}");
}
}
}
}

View File

@@ -40,6 +40,8 @@ namespace TerribleDev
string path)
{
req.HttpContext.Response.GetTypedHeaders().CacheControl = new Microsoft.Net.Http.Headers.CacheControlHeaderValue() {
Private = true,
NoCache = true,
NoStore = true
};
log.LogInformation($"redirect triggered: {DateTime.Now}");