Set response cache to an hour
This commit is contained in:
parent
672e56d0aa
commit
db29ac0891
|
|
@ -20,13 +20,22 @@ namespace AS1024.CommunityDocumentationPage.Controllers
|
|||
_documentation = documentation;
|
||||
}
|
||||
|
||||
[ResponseCache(Duration = 3600)]
|
||||
public async Task<IActionResult> Index()
|
||||
{
|
||||
var results = await _documentation.GetBgpCommunities();
|
||||
var filtered = results.Results.Where(b => b.Name.StartsWith(Configuration["ASN"]))
|
||||
.ToList();
|
||||
try
|
||||
{
|
||||
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]
|
||||
|
|
|
|||
Loading…
Reference in New Issue