Skip to content
Snippets Groups Projects
Commit 0d83ca4f authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets
Browse files

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
No related branches found
No related tags found
No related merge requests found
Pipeline #
Loading
@@ -272,4 +272,8 @@ module ProjectsHelper
Loading
@@ -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
Loading
@@ -49,7 +49,8 @@
Loading
@@ -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
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment