Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gitlab-ce
Commits
635ffe48
Commit
635ffe48
authored
Jul 09, 2015
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cache readme rendering result
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
5309dad4
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
1 deletion
+6
-1
app/helpers/projects_helper.rb
app/helpers/projects_helper.rb
+4
-0
app/views/projects/show.html.haml
app/views/projects/show.html.haml
+2
-1
No files found.
app/helpers/projects_helper.rb
View file @
635ffe48
...
@@ -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
app/views/projects/show.html.haml
View file @
635ffe48
...
@@ -49,6 +49,7 @@
...
@@ -49,6 +49,7 @@
%i
.fa.fa-file
%i
.fa.fa-file
=
readme
.
name
=
readme
.
name
.wiki
.wiki
=
cache
(
readme_cache_key
)
do
=
render_readme
(
readme
)
=
render_readme
(
readme
)
-
else
-
else
%h3
.page-title
%h3
.page-title
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment