Skip to content

Commit b4a7abe

Browse files
committed
Minor refresh
1 parent d67df61 commit b4a7abe

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

_posts/2023-10-16-what-is-the-maximum-max-age.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,14 @@
22
layout: post
33
title: "What Is the Maximum max-age?"
44
date: 2023-10-16 14:18:39
5+
last_modified_at: 2025-06-04
56
categories: Web Development
6-
meta: "We usually set max-age directives to a year; can we go longer?"
7+
meta: "How long?! RFC9111 lets max-age reach 68 years—far beyond the usual one that developers set. Here are the raw numbers, the spec, and when to use it."
78
faq:
89
- question: "What is the maximum value for cache-control’s max-age?"
9-
answer: "Conventionally, people tend to use one year, which is 3,1536,000 seconds. However, the spec says that caches MUST honour up to 2,147,483,648 seconds, which, in a 32-bit system, is the largest possible integer that can be represented in binary form. That’s a whopping 68 years!"
10+
answer: "Most teams stick to one year, but RFC9111 states caches MUST honour any value up to 2,147,483,648 seconds—68 years—the largest signed 32-bit integer."
11+
- question: "Should I swap my 31536000s for 2147483648s?"
12+
answer: "Maybe, but only for truly immutable, fingerprinted assets. HTML and API responses should keep short or revalidated lifetimes to avoid serving stale data."
1013
---
1114

1215
<p class="c-highlight">Try out the <a href="/max-age/"><code>max-age</code>
@@ -154,3 +157,6 @@ been stored for a year might not actually make it that long.
154157
This post was mostly an exercise in curiosity. But, if you wanted to, you could
155158
go ahead and swap all of your `31536000`s for `2147483648`s. It works in [all
156159
major browsers](https://cache-tests.fyi/).
160+
161+
Need a second pair of eyes on your caching strategy? Arrange a [performance
162+
audit](/performance-audits/)!

0 commit comments

Comments
 (0)