提交 0d83ca4f 编写于 作者: D Dmitriy Zaporozhets

Merge branch 'cache-readme' into 'master'

Cache readme rendering result

Markdown rendering is expensive. Lets cahce result
Signed-off-by: NDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>

See merge request !947
......@@ -272,4 +272,8 @@ module ProjectsHelper
current_user.recent_push(@project.id)
end
end
def readme_cache_key
[@project.id, @project.commit.sha, "readme"].join('-')
end
end
......@@ -49,7 +49,8 @@
%i.fa.fa-file
= readme.name
.wiki
= render_readme(readme)
= cache(readme_cache_key) do
= render_readme(readme)
- else
%h3.page-title
This project does not have README yet
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册