diff options
author | Oswaldo Ferreira <oswaldo@gitlab.com> | 2018-12-16 14:00:43 -0200 |
---|---|---|
committer | Oswaldo Ferreira <oswaldo@gitlab.com> | 2018-12-21 16:59:21 -0200 |
commit | 7cf4947792647fd985c38ebf37c27989fd5a1632 (patch) | |
tree | 46bef7a798e8749e815f594a918266c8d9f9dd61 /app/models/concerns/noteable.rb | |
parent | a9049532a271117983430d2d80b8ad61879ecf7a (diff) | |
download | gitlab-ce-7cf4947792647fd985c38ebf37c27989fd5a1632.tar.gz |
Cache diff highlight in discussions
This commit handles note diffs caching, which considerably improves
the performance on merge requests with lots of comments.
Important to note that the caching approach taken here is different
from `Gitlab::Diff::HighlightCache`. We do not reset the whole cache
when a new push is sent or anything else. That's because discussions
diffs are persisted and do not change.
Diffstat (limited to 'app/models/concerns/noteable.rb')
-rw-r--r-- | app/models/concerns/noteable.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/app/models/concerns/noteable.rb b/app/models/concerns/noteable.rb index f2cad09e779..29476654bf7 100644 --- a/app/models/concerns/noteable.rb +++ b/app/models/concerns/noteable.rb @@ -34,6 +34,10 @@ module Noteable false end + def preloads_discussion_diff_highlighting? + false + end + def discussion_notes notes end |