Commit Graph

28 Commits

Author SHA1 Message Date
GitLab Bot 71abc21e72 Add latest changes from gitlab-org/gitlab@master 2025-06-05 21:17:45 +00:00
GitLab Bot 84726c26f4 Add latest changes from gitlab-org/gitlab@master 2024-12-06 18:37:11 +00:00
GitLab Bot 9a676c5ccb Add latest changes from gitlab-org/gitlab@master 2024-05-30 09:24:02 +00:00
GitLab Bot 6b262ae86b Add latest changes from gitlab-org/gitlab@master 2024-02-27 12:08:45 +00:00
GitLab Bot 44667210f6 Add latest changes from gitlab-org/gitlab@master 2024-02-14 18:09:56 +00:00
GitLab Bot 336b65a1c7 Add latest changes from gitlab-org/gitlab@master 2024-02-14 09:08:15 +00:00
GitLab Bot 0b84d7017e Add latest changes from gitlab-org/gitlab@master 2024-02-08 18:11:25 +00:00
GitLab Bot f45c9dd1a8 Add latest changes from gitlab-org/gitlab@master 2024-02-08 09:11:21 +00:00
GitLab Bot 3b2d5044ab Add latest changes from gitlab-org/gitlab@master 2023-12-01 21:10:32 +00:00
GitLab Bot dc497ce27f Add latest changes from gitlab-org/gitlab@master 2023-08-15 21:09:57 +00:00
GitLab Bot 3a8d221b7e Add latest changes from gitlab-org/gitlab@master 2023-06-22 15:09:14 +00:00
GitLab Bot 8b0d3151ae Add latest changes from gitlab-org/gitlab@master 2023-06-08 18:08:59 +00:00
GitLab Bot 0552020767 Add latest changes from gitlab-org/gitlab@master 2022-11-16 15:10:52 +00:00
GitLab Bot 20f6a17ba2 Add latest changes from gitlab-org/gitlab@master 2022-11-09 18:07:50 +00:00
GitLab Bot 4c083c8163 Add latest changes from gitlab-org/gitlab@master 2022-08-19 15:11:58 +00:00
GitLab Bot 4bf395cded Add latest changes from gitlab-org/gitlab@master 2021-08-03 21:09:39 +00:00
GitLab Bot f397d486bc Add latest changes from gitlab-org/gitlab@master 2021-08-03 15:10:03 +00:00
GitLab Bot 1930898566 Add latest changes from gitlab-org/gitlab@master 2021-08-02 09:10:09 +00:00
GitLab Bot f4d51a9f71 Add latest changes from gitlab-org/gitlab@master 2021-07-29 15:09:48 +00:00
GitLab Bot 936d15143b Add latest changes from gitlab-org/gitlab@master 2021-07-26 21:08:38 +00:00
GitLab Bot 79f98200f8 Add latest changes from gitlab-org/gitlab@master 2021-06-07 15:09:56 +00:00
GitLab Bot 8322f05174 Add latest changes from gitlab-org/gitlab@master 2020-12-04 12:09:39 +00:00
GitLab Bot a4c6555151 Add latest changes from gitlab-org/gitlab@master 2020-07-01 12:09:08 +00:00
Mario de la Ossa e5705f5c54
Banzai - avoid redis if attr is in DB cache
When cache_collection_render runs we end up reading and writing
things to redis even if we already have the rendered field cached
in the DB. This commit avoids using redis at all whenever we have
the field already rendered in the DB cache.
2019-07-10 21:35:43 -06:00
Patrick Bajao ea12c5aae8 Cleanup #attributes method
Since we're prepending the ActiveRecord::Extension module, we
can take advantage of it and avoid using an alias to extend the
original #attributes method.
2019-06-05 20:30:43 +08:00
Patrick Bajao de21320db2 Remove requirement for id for #markdown_cache_key
It's not needed anymore as we require `#cache_key` instead.
2019-06-05 20:06:41 +08:00
Patrick Bajao 56d52340da Use #cache_key of subject for generated redis key
This commit also includes some changes in specs to use
`Class.new` approach.
2019-06-05 14:36:54 +08:00
Patrick Bajao 2eecfd8f9d Use Redis for CacheMarkDownField on non AR models
This allows using `CacheMarkdownField` for models that are not backed
by ActiveRecord.

When the including class inherits `ActiveRecord::Base` we include
`Gitlab::MarkdownCache::ActiveRecord::Extension`. 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::Redis::Extension`. This add the `<field>_html`
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 `id`.
2019-06-05 13:19:59 +08:00