Commit 0d83ca4f authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Merge branch 'cache-readme' into 'master'

Cache readme rendering result

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

See merge request !947
parents 5309dad4 635ffe48
......@@ -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,6 +49,7 @@
%i.fa.fa-file
= readme.name
.wiki
= cache(readme_cache_key) do
= render_readme(readme)
- else
%h3.page-title
......
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