Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Looks like solved it:</p> <ul> <li>Removed the proxy via header</li> <li>Added a Last-Modified header</li> <li>Added a far-future expires date</li> </ul> <p>Firebug still shows 200 responses from the origin server, however, YSlow recognizes the images as cached. According to YSlow, total image download size when fresh is greater than 500K; with the cache primed, it shows 0K download size.</p> <p>Here is the response header from the Origin server which does the trick:</p> <pre><code>Date: Tue, 24 Nov 2009 08:54:24 GMT Server: Apache/2.2.11 (Ubuntu) mod_apreq2-20051231/2.6.0 mod_perl/2.0.4 Perl/v5.10.0 Last-Modified: Sun, 22 Nov 2009 07:28:25 GMT Expires: Tue, 30 Nov 2010 19:00:25 GMT Content-Length: 10883 Content-Type: image/jpeg Keep-Alive: timeout=15, max=89 Connection: Keep-Alive </code></pre> <p>Because of the way I'm requesting the images, it really should not matter if these dates are static; my app knows the last mod time before requesting the image and appends this to the request URL on the client side to create a unique URL for each image version, e.g. <a href="http://myserver.com/img/125.jpg?20091122" rel="nofollow noreferrer">http://myserver.com/img/125.jpg?20091122</a> (the info comes from a AJAX JSON feed). I could, for example, make the last modified date 01 Jan 2000, and the Expires date sometime in the year 2050.</p> <p>If YSlow is correct -- and performance testing implies it is -- then FireBug should really report these local cache hits instead of a 200 response.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload