Cache flow problems, II

Google [1] just announced that website speed is part of their ranking criteria [2] (link via Hacker News [3]), and seeing how Dad is still reporting issues with viewing this blog [4], I figured I might as well play around with Page Speed [5] (which requires Firebug [6], an incredible website debugging tool that runs in Firefox [7]) and see if I can't fix the issue (and maybe speed up the site).

Now, I realize there isn't any real need to speed up my site, but the suggestions by Page Speed weren't horrible, and actually, not terribly hard to implement (seeing how the main website here [8] consists of nothing but static pages, with the only dynamic content here on the blog [9]) and mainly consisted of tuning various caching options on the pages, and some minor CSS (Cascading Style Sheet) tweaks to keep Page Speed happy.

The caching tweaks for the main site [10] I made were:

>
```
FileETag [11] MTime Size
AddType [12] "image/x-icon" .ico
ExpiresActive [13] On
ExpiresDefault [14] "access plus 1 year"
ExpiresByType [15] text/html "access plus 1 week"
ExpiresByType image/x-icon "access plus 1 month"
<LocationMatch [16] "\.(ico|gif|png|jpg|jpeg)$">
Header [17] append Cache-Control [18] "public"
</LocationMatch>
```

HTML (HyperText Markup Language) pages can be cached for a week, favicon.ico [19] can be cached for a month, and everything else for a year. Yes, I could have made favicon.ico cache for a year, but Page Speed suggested at least a month, so I went with that. I can always change that later. I may revisit the caching for HTML pages later; make non-index pages cachable for a year, and index pages a week, but for now, this is fine.

And it does make the pages load up faster, at least for subsequent visits. Also, Page Speed and YSlow [20] both give me high marks (YSlow dings me for not using a CDN (Content Delivery Network), but my site isn't big enough to require a CDN, but that's the only thing YSlow doesn't like about my site).

And as an attempt to fix Dad's issue, I added the following to the configuration for The Boston Diaries [21]:

>
```
<Files [22] index.html>
Header set Cache-Control "no-cache"
</Files>
```

Basically, no one is allowed to cache the main page for this blog. I'll see how well that works, although it may take a day or two.

[1] http://www.google.com/

[2] http://googlewebmastercentral.blogspot.com/2010/04/using-site-speed-in-web-search-ranking.html

[3] http://news.ycombinator.com/item?id=1253528

[4] /boston/2010/03/08.3

[5] http://code.google.com/speed/page-speed/

[6] http://getfirebug.com/

[7] http://www.mozilla.com/firefox/

[8] http://www.conman.org/

[9] https://boston.conman.org/

[10] http://www.conman.org/

[11] http://httpd.apache.org/docs/2.0/mod/core.html#fileetag

[12] http://httpd.apache.org/docs/2.0/mod/mod_mime.html#addtype

[13] http://httpd.apache.org/docs/2.0/mod/mod_expires.html#expiresactive

[14] http://httpd.apache.org/docs/2.0/mod/mod_expires.html#expiresdefault

[15] http://httpd.apache.org/docs/2.0/mod/mod_expires.html#expiresbytype

[16] http://httpd.apache.org/docs/2.0/mod/core.html#locationmatch

[17] http://httpd.apache.org/docs/2.0/mod/mod_headers.html#header

[18] http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9

[19] http://en.wikipedia.org/wiki/Favicon

[20] http://developer.yahoo.com/yslow/

[21] https://boston.conman.org/

[22] http://httpd.apache.org/docs/2.0/mod/core.html#files

Gemini Mention this post

Contact the author