> curl --head http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js
HTTP/1.1 200 OK
Last-Modified: Thu, 19 Feb 2009 22:38:52 GMT
Content-Type: application/x-javascript; charset=UTF-8
Expires: Fri, 27 Aug 2010 18:40:36 GMT
Date: Thu, 27 Aug 2009 18:40:36 GMT
Vary: Accept-Encoding
X-Content-Type-Options: nosniff
Cache-Control: public, max-age=31536000
Age: 7435
Server: GFE/2.0
Transfer-Encoding: chunked

It says expires 27 Aug 2010. Hower the cache-control says max-age = 315360000 (far far in future). Does it mean browser will cache this data for a long time? Or based on expires value it will request another copy immediately?

3 Answers 3


My understanding is that the Expires header is the old method of doing it, and Cache-Control is the modern way of doing it, which allows more granularity for dealing with proxy servers, etc.

In either case, version 1.3.2 of the file will always be version 1.3.2, so they both are saying to cache it for a long, long time.


The value you pasted from curl for max-age was 31536000, or 1 year. So both headers are saying the same thing: consider the content fresh for one year.


If there is a conflict between Cache-Control and Expires, the browser should listen to Cache-Control,

This means that Cache-Control overrides Expires (This is written in HTTP/1.1 docs)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.