Mobile app version of vmapp.org
Login or Join
Voss4911412

: Why is "29030400" seconds used as a common value for cache expiration? I noticed that 29030400 is used very often in the Expires directives for static files. Google recommends to cache this

@Voss4911412

Posted in: #CacheControl #Expires #HttpHeaders

I noticed that 29030400 is used very often in the Expires directives for static files.

Google recommends to cache this kind of files up to 1 year (1 month at least).

I did the math: 29030400 seconds = 336 days

That is about 1 year minus 1 month, so it perfectly falls in the recommended interval, but the question is why exactly 29030400? And not 31536000 seconds = 365 days for example? Just a blind copy/paste of a value that was set randomly in the old days? Or does it have another explanation?

10.02% popularity Vote Up Vote Down


Login to follow query

More posts by @Voss4911412

2 Comments

Sorted by latest first Latest Oldest Best

 

@Ann8826881

Unor is correct.
It's like finding 2419200 seconds in a 4 week month then multiplying by 12 for a year 29030400.

However as you mention, that is not very accurate as many months have 31 days, 5 weeks, etc.

I provide an additional answer (even though the correct answer has been provided) simply to provide the exact seconds for a "gregorian year" which also includes those 5 week months, 28 days in February, etc. In case anyone needs that number.

There are 31556952 seconds in 1 gregorian year.
If you want an exact year in your cache, this may be the number you are looking to use on your cache expirations. :)

10% popularity Vote Up Vote Down


 

@Ogunnowo487

It might come from

60 * 60 * 24 * 7 * 4 * 12 = 29030400


where each month consists of exactly 4 weeks.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme