You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please use the 👍 reaction to show that you are interested into the same feature.
Please don't comment if you have no relevant information to add. It's just extra noise for everyone subscribed to this issue.
Subscribe to receive notifications on status change and new comments.
Is your feature request related to a problem? Please describe.
SELECT * FROM `oc_authtoken` WHERE (`token` = :dcValue1) AND (`version` = :dcValue2) is one of the most common queries in Nextcloud executed most requests.
Describe the solution you'd like
Cache the lookup
Positive cache for rows that exist. Keep data in memory for a few seconds to eliminate database lookups for highly concurrent requests of one user.
Keep TTL low enough to kill any connections when the token is deleted within reasonable time (30s?)
For time-critical data, like the password, \OC\Authentication\Token\PublicKeyTokenProvider::getPassword could still fetch the latest version from the database, to avoid reading an outdated password. This might be debatable and we could accept some failing authentication on external storage etc. for the short period of time where the password changes.
Negative cache for rows that do not exist. The tokens are random so it's very unlikely that a token that doesn't exist right now will exist in the next few minutes. Yet if a client retries their token again and again we hit the database for each request.
Describe alternatives you've considered
N/a
Additional context
N/a
The text was updated successfully, but these errors were encountered:
How to use GitHub
Is your feature request related to a problem? Please describe.
SELECT * FROM `oc_authtoken` WHERE (`token` = :dcValue1) AND (`version` = :dcValue2)
is one of the most common queries in Nextcloud executed most requests.Describe the solution you'd like
Cache the lookup
\OC\Authentication\Token\PublicKeyTokenProvider::getPassword
could still fetch the latest version from the database, to avoid reading an outdated password. This might be debatable and we could accept some failing authentication on external storage etc. for the short period of time where the password changes.Describe alternatives you've considered
N/a
Additional context
N/a
The text was updated successfully, but these errors were encountered: