Use this Max-Age Cache Calculator to convert structured time (years, days, hours, minutes) into max-age
seconds for HTTP caching. Get instant breakdowns and header examples.
Features:
Input Options
- Dual input methods: Enter raw seconds or use structured inputs for years, days, hours, and minutes.
- Instant conversion: All inputs update the calculated max-age value and HTTP cache header in real time.
Output and Layout
- Readable output: See a breakdown of your input in days, hours, minutes, and seconds.
- Header-ready: Includes a complete
Cache-Control: public, max-age=...
header line for copy-paste use.
Controls
- Copy Output: Copies the full breakdown and header.
- Clear All: Resets everything instantly.
- Recalculate: Forces manual refresh of the result (optional, input is auto-reactive).
How to Use the Max-Age Cache Calculator:
- Enter a value one of two ways:
- Use the “Max-Age (in seconds)” field (e.g.
604800
) - Or use the Years / Days / Hours / Minutes input boxes
- Use the “Max-Age (in seconds)” field (e.g.
- View the live result in the Cache Duration box:
- Human-readable time breakdown
- Complete example HTTP header for caching
- Copy Output if needed using the button below the output.
- Click “Clear All” to reset everything and start fresh.
Example:
Duration Input:
Years: 1
Days: 0
Hours: 0
Minutes: 0
Output:
Max-Age: 31536000 seconds
= 365 day(s), 0 hour(s), 0 minute(s), 0 second(s)
Example Header:
Cache-Control: public, max-age=31536000
Days From Now Calculator Table:
The Max-Age Cache Calculator Table helps you understand what each max-age
value actually means in seconds, minutes, hours, and days. Whether you’re setting cache headers in Cache-Control
or just trying to decode what max-age=31536000
really represents, this table gives you an instant reference. Each row breaks down common max-age durations into readable timeframes, along with example use cases like static assets, API responses, or HTML pages. It’s a quick way to make smarter caching decisions and avoid guessing how long “2592000 seconds” really is.
Max-Age (seconds) | Time (approx) | Readable Duration |
---|---|---|
60 | 1 minute | Short caching, testing |
300 | 5 minutes | APIs, JSON endpoints |
600 | 10 minutes | User dashboard data |
1800 | 30 minutes | Partial page caching |
3600 | 1 hour | HTML pages |
10800 | 3 hours | API keys, login states |
21600 | 6 hours | Category pages |
43200 | 12 hours | Ecommerce content |
86400 | 1 day | Homepage, main blog |
172800 | 2 days | Product pages |
259200 | 3 days | Category filters |
604800 | 1 week | Images, CSS, JS |
1209600 | 2 weeks | Static content |
2592000 | 30 days | Fonts, third-party libs |
31536000 | 365 days | Immutable versioned assets |
Common Use Cases:
The Max-Age Tool calculates cache duration from seconds or time units like years, days, hours, and minutes. It’s ideal for setting HTTP cache-control headers, optimizing website caching strategies, defining expiration times for static assets, managing cache settings for servers and CDNs, and ensuring accurate control over cache lifetimes.
Useful Tools & Suggestions:
If you’re working with cache headers, Convert Seconds to Time helps you turn max-age values into readable formats fast. And when you’re comparing multiple durations or planning expiration policies, Find Time Difference gives you an easy way to measure the gaps between them.