Commit ae69176e authored by Kati Paizee's avatar Kati Paizee

Merge branch 'document-request-caching-gotchas' into 'master'

Document issue encountered with request caching of broadcast messages

See merge request gitlab-org/gitlab!81375
parents e824a2de 7d4b2349
...@@ -265,6 +265,13 @@ All the time! ...@@ -265,6 +265,13 @@ All the time!
- As the lookup is similar to a cache lookup (in the GitLab implementation), we can use - As the lookup is similar to a cache lookup (in the GitLab implementation), we can use
the same key for both. This is how `Gitlab::Cache.fetch_once` works. the same key for both. This is how `Gitlab::Cache.fetch_once` works.
#### Possible downsides
- Adding new attributes to a cached object using `Gitlab::JsonCache`
and `Gitlab::SafeRequestStore`, for example, can lead to stale data issues
where the cache data doesn't have the appropriate value for the new attribute
(see this past [incident](https://gitlab.com/gitlab-com/gl-infra/production/-/issues/6372)).
### When to use SQL caching ### When to use SQL caching
Rails uses this automatically for identical queries in a request, so no action is Rails uses this automatically for identical queries in a request, so no action is
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment