Use Redis for CacheMarkDownField on non AR models
What does this MR do?
This allows using
CacheMarkdownField for models that are not backed
When the including class inherits
ActiveRecord::Base we include
Gitlab::MarkdownCache::ActiveRecordBacked. This will cause the
markdown fields to be rendered and the generated HTML stored in a
<field>_html attribute on the record. We also store the version
used for generating the markdown.
All other classes that include this model will include the
Gitlab::MarkdownCache::RedisBacked. This add the
attributes to that model and will generate the html in them. The
generated HTML will be cached in redis under the key
markdown_cache:<class>:<id>. The class this included in must
therefore respond to
What are the relevant issue numbers?
Closes #54140 (closed) after the performance regression introduced in a security fix.
Does this MR meet the acceptance criteria?
- Changelog entry added, if necessary
- Documentation created/updated
- Tests added for this feature/bug
- Conforms to the code review guidelines
- Conforms to the merge request performance guidelines
- Conforms to the style guides
- Conforms to the database guides
- Link to e2e tests MR added if this MR has Requires e2e tests label. See the Test Planning Process.
- Security reports checked/validated by reviewer