add action cache 🎨

This commit is contained in:
anjoy8 2019-06-14 16:14:11 +08:00
parent fd2c58eee2
commit 9c5058b84c
4 changed files with 5 additions and 0 deletions

View File

@ -48,6 +48,8 @@ namespace Blog.Core.Controllers
/// <returns></returns>
[HttpGet]
[AllowAnonymous]
//[ResponseCache(Location = ResponseCacheLocation.None, NoStore = true)]
[ResponseCache(Duration = 600)]
public async Task<object> Get(int id, int page = 1, string bcategory = "技术博文", string key = "")
{
int intTotalCount = 6;

View File

@ -267,6 +267,7 @@ namespace Blog.Core.Controllers
/// <param name="uid"></param>
/// <returns></returns>
[HttpGet]
[ResponseCache(Duration = 3600)]
public async Task<MessageModel<NavigationBar>> GetNavigationBar(int uid)
{

View File

@ -35,6 +35,7 @@ namespace Blog.Core.Controllers
/// <returns></returns>
// GET: api/User
[HttpGet]
[ResponseCache(Duration = 3600)]
public async Task<MessageModel<PageModel<Role>>> Get(int page = 1, string key = "")
{
if (string.IsNullOrEmpty(key) || string.IsNullOrWhiteSpace(key))

View File

@ -48,6 +48,7 @@ namespace Blog.Core.Controllers
/// <returns></returns>
// GET: api/User
[HttpGet]
[ResponseCache(Duration = 3600)]
public async Task<MessageModel<PageModel<sysUserInfo>>> Get(int page = 1, string key = "")
{
if (string.IsNullOrEmpty(key) || string.IsNullOrWhiteSpace(key))