Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the timespan type of max-age in the HTTP response header? Seconds, minutes?

In the HTTP response header for my website it is returning a header that contains the following value.

"Cache-Control: max-age=3600" 

Is 3600 in seconds or minutes?

like image 458
Paul Mendoza Avatar asked Aug 01 '11 05:08

Paul Mendoza


People also ask

What is Max age in HTTP header?

max-age. The max-age directive states the maximum amount of time in seconds that fetched responses are allowed to be used again (from the time when a request is made). For instance, max-age=90 indicates that an asset can be reused (remains in the browser cache) for the next 90 seconds.

Is Max age seconds or milliseconds?

It's in seconds, so the value you quoted corresponds to 1 hour.

How long is Max age 31536000?

Max-age greater than 31536000 (one year) makes little sense, and informally this is considered a reasonable maximum value.

Which response header will tell the client that the response is cached for 1 minute?

Cache-control is an HTTP header used to specify browser caching policies in both client requests and server responses. Policies include how a resource is cached, where it's cached and its maximum age before expiring (i.e., time to live).


2 Answers

delta seconds. http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9.3

max-age

Indicates that the client is willing to accept a response whose age is no greater than the specified time in seconds...

like image 169
jcomeau_ictx Avatar answered Oct 11 '22 23:10

jcomeau_ictx


It's in seconds, so the value you quoted corresponds to 1 hour.

like image 27
Andrew Cooper Avatar answered Oct 11 '22 22:10

Andrew Cooper