card images slow to download
Anonymous
GUESTS
This isn't really a bug, but my browser seems to reload the Freecell card images every day. This can actually take quite a while.
Since you're using an Apache server, you can speed things up by sending a Cache-Control header along with the images. This is very easy to do -- just add the following to your .htaccess file:
Since you're using an Apache server, you can speed things up by sending a Cache-Control header along with the images. This is very easy to do -- just add the following to your .htaccess file:
# Allow PNG images to be cached for 4 weeks
<FilesMatch "\.png$">
Header set Cache-Control "max-age=2419200, public"
</FilesMatch>
Comments
I had been expecting the browsers to cache the files (they do), and for them to use HTTP pipelining when checking for out of date cached files (they don't). Checking 52 image's cache status synchronously leads to major latency issues and makes it look like loading the images takes a long time even though they are cached.
I also tried implementing a single deck image CSS sprite technique to avoid the need to make up a cache time (28 days seems fine for now), but I still haven't gotten IE6 support working yet.
Thanks for the suggestion,
-Jim
Unfortunately I'm still getting long page load times. I guess it's not because the images are downloading every time but because the server is sending each 304 Not Modified response over a separate connection.
You could probably fix that by increasing the value of MaxKeepAliveRequests and perhaps reducing the value of KeepAliveTimeout to 5 seconds or so in the server settings, but unfortunately you can only set these in httpd.conf — they don't work in .htaccess files.