Created attachment 563922 [details] Unnecessary Requests Description of problem: When serving static assets (e.g., stylesheets, JavaScript, images), we don't set any headers indicating that they can be cached. Apache sets an Etag, but that still requires that we do a conditional GET on every request. (The conditional GET saves the bandwidth of serving the image again, but still incurs the latency of the HTTP request.) We end up with at least a dozen unnecessary HTTP requests on every page. AssetTagHelper appends timestamps as a query parameter, so we can set a Cache-Control directive allowing these assets to be cached forever -- if we change a stylesheet, it will end up with a new timestamp in the URL and get reloaded automatically. I'm attaching a screenshot showing Firebug with a warm cache. Note that there are many more queries not depicted because I expanded the CSS to show the Etag header and the If-None-Match / If-Modified-Since conditional GET. This needs to be fixed in our Apache config.
Patch sent to list - https://fedorahosted.org/pipermail/aeolus-devel/2012-February/009072.html
ACKed (with trivial change) and pushed onto master: b69c475e8e0cbf765655d4fdce4ca1d2c5957cf4
Date Fri, 24 Feb 2012 02:51:35 GMT Etag "31a6061-64e-4b994793a39c0" Expires Sat, 23 Feb 2013 02:51:35 GMT looks like it expires in one year.. verified HeadersResponseCache Response Headers Accept-Ranges bytes Cache-Control max-age=31536000 Content-Length 1614 Content-Type text/css Date Fri, 24 Feb 2012 02:51:35 GMT Etag "31a6061-64e-4b994793a39c0" Expires Sat, 23 Feb 2013 02:51:35 GMT Last-Modified Wed, 22 Feb 2012 21:47:27 GMT Server Apache/2.2.15 (Red Hat) Request Headers Accept text/css,*/*;q=0.1 Accept-Charset ISO-8859-1,utf-8;q=0.7,*;q=0.7 Accept-Encoding gzip, deflate Accept-Language en-us,en;q=0.5 Connection keep-alive Cookie _session_id=daed0e167803d8d80daadec694a91f10 Host qeblade31.rhq.lab.eng.bos.redhat.com Referer https://qeblade31.rhq.lab.eng.bos.redhat.com/conductor/images/new?environment=1 User-Agent Mozilla/5.0 (X11; Linux i686; rv:9.0.1) Gecko/20100101 Firefox/9.0.1 Response Headers From Cache Accept-Ranges bytes Cache-Control max-age=31536000 Content-Length 1614 Content-Type text/css Date Fri, 24 Feb 2012 02:51:35 GMT Etag "31a6061-64e-4b994793a39c0" Expires Sat, 23 Feb 2013 02:51:35 GMT Last-Modified Wed, 22 Feb 2012 21:47:27 GMT Server Apache/2.2.15 (Red Hat) [root@qeblade31 conf]# rpm -qa | grep aeolus aeolus-conductor-daemons-0.8.0-35.el6.noarch rubygem-aeolus-image-0.3.0-9.el6.noarch rubygem-aeolus-cli-0.3.0-10.el6.noarch aeolus-all-0.8.0-35.el6.noarch aeolus-conductor-0.8.0-35.el6.noarch aeolus-conductor-doc-0.8.0-35.el6.noarch aeolus-configure-2.5.0-15.el6.noarc