Commit 635ffe48 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Cache readme rendering result

Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
parent 5309dad4
...@@ -272,4 +272,8 @@ module ProjectsHelper ...@@ -272,4 +272,8 @@ module ProjectsHelper
current_user.recent_push(@project.id) current_user.recent_push(@project.id)
end end
end end
def readme_cache_key
[@project.id, @project.commit.sha, "readme"].join('-')
end
end end
...@@ -49,7 +49,8 @@ ...@@ -49,7 +49,8 @@
%i.fa.fa-file %i.fa.fa-file
= readme.name = readme.name
.wiki .wiki
= render_readme(readme) = cache(readme_cache_key) do
= render_readme(readme)
- else - else
%h3.page-title %h3.page-title
This project does not have README yet This project does not have README yet
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment