output cache all the things

This commit is contained in:
Tommy Parnell
2019-02-03 13:01:21 -05:00
parent de62e6275d
commit dbb6ae208b
2 changed files with 3 additions and 2 deletions

View File

@@ -47,6 +47,7 @@ namespace TerribleDev.Blog.Web.Controllers
[Route("/")]
[Route("/index.html")]
[Route("/page/{pageNumber?}" )]
[OutputCache(Duration = 31536000, VaryByParam = "pageNumber")]
public IActionResult Index(int pageNumber = 1)
{
if(!postsByPage.TryGetValue(pageNumber, out var result))

View File

@@ -26,7 +26,7 @@ namespace TerribleDev.Blog.Web.Controllers
[Route("/rss")]
[Route("/rss.xml")]
[ResponseCache(Duration = 7200)]
[OutputCache(Duration = 86400)]
[OutputCache(Duration = 31536000)]
public async Task Rss()
{
Response.StatusCode = 200;
@@ -49,7 +49,7 @@ namespace TerribleDev.Blog.Web.Controllers
}
[Route("/sitemap.xml")]
[ResponseCache(Duration = 7200)]
[OutputCache(Duration = 86400)]
[OutputCache(Duration = 31536000)]
public void SiteMap()
{
Response.StatusCode = 200;