I am storing detail of a user for one day. Which one of below is better approach assuming this user is viewed 2k times in day .
TTL set one time
Set TTL of 24hours. On every access to the user we will fetch data from Redis and won't update TTL. after 24 hours, when the key was expired update the TTL.
TTL set on every request.
Set TTL of 4hours. On every access to the user we will fetch data from Redis and update TTL to +4 hours from now. unused keys will automatically expire.
Question: I feel the first approach is better as on 2nd approach we don't need to update TTL 10k times(views) and need to fire query only one time. Please suggest which is better approach?