增加文章缓存功能

This commit is contained in:
lifei6671
2018-07-23 16:25:39 +08:00
parent 1eae95ea5d
commit ca60f49cc9
2 changed files with 26 additions and 1 deletions

View File

@@ -32,7 +32,7 @@ func (c *BlogController) Index() {
}
blogReadSession := fmt.Sprintf("blog:read:%d",blogId)
blog,err := models.NewBlog().Find(blogId)
blog,err := models.NewBlog().FindFromCache(blogId)
if err != nil {
c.ShowErrorPage(404,"文章不存在")