prevent caching of livecheck
This commit is contained in:
@@ -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}");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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}");
|
||||
|
||||
Reference in New Issue
Block a user