Investigate possibility of using `Rails.cache` for `Gitlab::Diff::HighlightCache`
While investigating problems with our Redis cache, @igorwwwwwwwwwwwwwwwwwwww noted that highlighted-diff-files:merge_request_diffs:
has pretty large values.
Gitlab::Diff::HighlightCache
doesn't use Rails.cache
so it does not benefit from compression which we enabled recently in !27254 (merged).
Taking a quick look at the code, it doesn't seem like we really need or use Redis' hash data structure here. So it might be possible to switch this to use Rails.cache
and just let Rails serialize the Ruby hash.
Switching would mean we lose our currently cached data though unless we write some compatibility layer to transition these keys.
I do see 3fa823e3 which implies that a hash was used intentionally so that we can access individual diff files. But not sure if that still applies.
What do you think @kerrizor?