Cache readme rendering result

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
This commit is contained in:
Dmitriy Zaporozhets 2015-07-09 14:47:28 +02:00
parent 5309dad459
commit 635ffe4841
No known key found for this signature in database
GPG Key ID: 161B5D6A44D3D88A
2 changed files with 6 additions and 1 deletions

View File

@ -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

View File

@ -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