I have noticed that the CSS file is not being cached in the Chrome browser. My application is created using Angular-CLI and all the necessary cache-control headers are set, with an Expires header of 5 minutes:
Accept-Ranges:bytes
Cache-Control:max-age=600
Content-Encoding:gzip
Content-Type:text/css
Date:Wed, 13 Sep 2017 05:11:17 GMT
ETag:W/"441246-1505278984000"
Expires:Wed, 13 Sep 2017 05:21:18 GMT
Last-Modified:Wed, 13 Sep 2017 05:03:04 GMT
Server:Apache-Coyote/1.1
Transfer-Encoding:chunked
Vary:Accept-Encoding
Interestingly, JS files with the same response headers are being successfully cached. The CSS file is also cached in Firefox Mozilla. I have researched some posts and come across a few suggestions:
Chrome may not cache resources with self-signed certificates or over HTTPS if there is an SSL error. However, for me, other files like .js and .png are on the same channel and are being cached.
Could the
Transfer-Encoding: chunked
be causing issues with caching on Chrome, even though it works fine in FireFox?There have been mentions that gzip compression does not work well with Chrome: https://github.com/expressjs/compression/issues/64
Any suggestions or pointers would be greatly appreciated.