Use a shorter TTL for Repository#exists? caching
What does this MR do?
Use a custom expiry time for the cached value of Repository#exists?
.
Are there points in the code the reviewer needs to double check?
Why was this MR needed?
The default cache expiry time is two weeks (the expiry time of Rails.cache). This means that if we get false negatives in the cache for Repository#exists? (this has happened) and if there are bugs that prevent this false negative from being removed from the cache (this has also happened), the repository is effectively gone for two weeks or until administrators intervene by manipulating the Redis cache behind the scenes.
In this change we add a custom Redis cache mechanism for Repository#exists? with an expiry time of 10 minutes. This is an arbitrary value I came up with which I think is long enough for the cache to have a significant benefit and short enough so that in the case of cache poisoning the nuisance for users is of a limited scope.
Screenshots (if relevant)
Does this MR meet the acceptance criteria?
-
Changelog entry added, if necessary -
Documentation created/updated -
API support added -
Tests added for this feature/bug - Review
-
Has been reviewed by UX -
Has been reviewed by Frontend -
Has been reviewed by Backend -
Has been reviewed by Database
-
-
Conform by the merge request performance guides -
Conform by the style guides -
Squashed related commits together