# Setting Expiry

> How do you set a key to expire in 60 seconds in Redis, and how do you check or change its remaining time?

Canonical: https://www.internhack.in/learn/interview/redis-caching/redis-ttl-command
Last updated: 2026-11-28

Difficulty: Beginner

## Question

How do you set a key to expire in 60 seconds in Redis, and how do you check or change its remaining time?

*The full answer is for InternHack members. Open the page link above to read it.*

## Concepts covered

EXPIRE, SET EX, TTL and PTTL, PERSIST, Lazy and Active Expiry

Previous: [HyperLogLog](https://www.internhack.in/learn/interview/redis-caching/redis-hyperloglog) · Next: [Redis Info](https://www.internhack.in/learn/interview/redis-caching/redis-info-command) · [All of Redis & Caching](https://www.internhack.in/learn/interview/redis-caching)

## More Redis & Caching questions

- [Runtime Configuration](https://www.internhack.in/learn/interview/redis-caching/redis-config-get-set)
- [Real-time Monitoring](https://www.internhack.in/learn/interview/redis-caching/redis-monitor-command)
- [SCAN over KEYS](https://www.internhack.in/learn/interview/redis-caching/redis-scan-vs-keys)
- [DEL vs. UNLINK](https://www.internhack.in/learn/interview/redis-caching/redis-del-vs-unlink)
- [Geospatial Indexing](https://www.internhack.in/learn/interview/redis-caching/redis-geo-commands)
- [Blocking List Pops](https://www.internhack.in/learn/interview/redis-caching/redis-blocking-lists-brpop)

## Related

- [Learn](https://www.internhack.in/learn)
- [Interview Prep](https://www.internhack.in/learn/interview)
- [Redis & Caching](https://www.internhack.in/learn/interview/redis-caching)
