GitLab steht aufgrund wichtiger Wartungsarbeiten am Montag, den 8. März, zwischen 17:00 und 19:00 Uhr nicht zur Verfügung.

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 @@ def last_push_event
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% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment