Redis & Caching (50 Qs)•Part 3: Advanced Internals, Scale & Production Patterns (Senior / Lead)
What is the difference between `EXPIRE` and `PEXPIRE`?
senior LevelredisAdvanced Internals
In Simple Words:
EXPIRE key seconds: Sets TTL in whole seconds.PEXPIRE key milliseconds: Sets TTL with millisecond precision.- Internally, Redis always converts all expiration timestamps to Unix epoch in milliseconds for consistency across replication and restarts.