We are using IBM HTTP server as our web server. Whenever a request is sent to homepage, browser is caching all static files like js or images except CSS.
Why is it caching JS files which are also static but not CSS?
Below are the request and response headers for CSS:
Status Code:200 OK
**Request Headersview**
Accept:text/css,*/*;q=0.1
Accept-Charset:ISO-8859-1,utf-8;q=0.7,*;q=0.3
Accept-Encoding:gzip,deflate,sdch
Accept-Language:en-US,en;q=0.8
Cache-Control:max-age=0
DNT:1
If-Modified-Since:Thu, 14 Feb 2013 20:38:02 GMT
If-None-Match:"6b01-4d5b53c299e80"
Proxy-Connection:keep-alive
User-Agent:Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.31 (KHTML, like Gecko) Chrome/26.0.1410.3 Safari/537.31
**Response Headersview**
Accept-Ranges:bytes
Age:0
Cache-Control:max-age=172800
Connection:Keep-Alive
Content-Encoding:gzip
Content-Length:5831
Content-Type:text/css
Date:Tue, 26 Feb 2013 23:50:59 GMT
ETag:"6b01-4d5b53c299e80"
Expires:Thu, 28 Feb 2013 23:50:59 GMT
Last-Modified:Thu, 14 Feb 2013 20:38:02 GMT
Proxy-Connection:Keep-Alive
Server:IBM_HTTP_Server
Vary:Accept-Encoding,User-Agent
Via:1.1 localhost.localdomain
And these are headers for JS files which are returning 304:
**Request Headersview**
Accept:*/*
Accept-Charset:ISO-8859-1,utf-8;q=0.7,*;q=0.3
Accept-Encoding:gzip,deflate,sdch
Accept-Language:en-US,en;q=0.8
Cache-Control:max-age=0
DNT:1
If-Modified-Since:Thu, 14 Feb 2013 20:38:10 GMT
If-None-Match:"7bcc-4d5b53ca3b080"
Proxy-Connection:keep-alive
User-Agent:Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.31 (KHTML, like Gecko) Chrome/26.0.1410.3 Safari/537.31
**Response Headersview**
Cache-Control:max-age=172800
Connection:Keep-Alive
Date:Tue, 26 Feb 2013 23:50:58 GMT
Etag:"7bcc-4d5b53ca3b080"
Expires:Thu, 28 Feb 2013 23:50:59 GMT
Proxy-Connection:Keep-Alive
Vary:Accept-Encoding,User-Agent
Via:1.1 localhost.localdomain