I am using Redis in my application. I am caching the access token on redis with the expiration time as 2 weeks(1209600 seconds). But the token get delete in within 5-6 minutes. I have monitored the same on redis terminal with TTL command. After expiring 600-700 seconds, the TTL command gives -2. I don't know how redis automatically deleting the data or expiring the cache before the expiration of TTL. Can someone please help me here that is there any configuration which I need to change on redis server. Thanks
Asked
Active
Viewed 56 times
0
-
Can you share how you're creating entries? Also, I assume your server isn't at memory capacity. – Matthew Apr 05 '22 at 21:57
-
On a high level, I am using following code to set the data in redis: `@Autowired RedisConnectionFactory connectionFactory; RedisConnection conn = connectionFactory.getConnection(); conn.expire("token", 1209600);` Also I used 'TTL token' command to keep on checking the remaining expiration time and suddenly after 10 min this command shows -2. – Om Prakash Apr 06 '22 at 09:07
-
which memory capacity you are talking about. How can I see the default or current capacity and then how can i change the same. – Om Prakash Apr 06 '22 at 17:24