Set response cache to an hour
This commit is contained in:
@@ -20,13 +20,22 @@ namespace AS1024.CommunityDocumentationPage.Controllers
|
|||||||
_documentation = documentation;
|
_documentation = documentation;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[ResponseCache(Duration = 3600)]
|
||||||
public async Task<IActionResult> Index()
|
public async Task<IActionResult> Index()
|
||||||
{
|
{
|
||||||
var results = await _documentation.GetBgpCommunities();
|
try
|
||||||
var filtered = results.Results.Where(b => b.Name.StartsWith(Configuration["ASN"]))
|
{
|
||||||
.ToList();
|
var results = await _documentation.GetBgpCommunities();
|
||||||
|
var filtered = results.Results.Where(b => b.Name.StartsWith(Configuration["ASN"]))
|
||||||
|
.ToList();
|
||||||
|
|
||||||
return View(filtered);
|
return View(filtered);
|
||||||
|
} catch (Exception ex)
|
||||||
|
{
|
||||||
|
_logger.LogError($"Failed to obtain data\n{ex}");
|
||||||
|
}
|
||||||
|
|
||||||
|
return View();
|
||||||
}
|
}
|
||||||
|
|
||||||
[NonAction]
|
[NonAction]
|
||||||
|
|||||||
Reference in New Issue
Block a user