Well, I took a quick look at my Page Speed results today, and it looks like Google is angry at me for my inability to leverage browser caching. Essentially, I’m reaching out to the server for every image on my site, even if the user has loaded it already. Seems like a ton of extra unnecessary work eh?
Well, htaccess to the rescue! I added the following to my .htaccess file, which sped up my site considerably (and also upped my Page Speed score). I opted to set my headers to a long time for both images, css, and js for now, since I don’t really update the look of my site that often. When I do decide to, I’ll most likely rename my js and css files, and removed the old ones.
# Setting Cache Control Headers # 480 weeks <filesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf)$"> Header set Cache-Control "max-age=290304000, public" </filesMatch> # 2 DAYS <filesMatch "\.(xml|txt)$"> Header set Cache-Control "max-age=172800, public, must-revalidate" </filesMatch> # 2 HOURS <filesMatch "\.(html|htm)$"> Header set Cache-Control "max-age=7200, must-revalidate" </filesMatch>
Anyone out there have any suggestions on ways to set cache control? This was my first attempt at it, and I’d love some feedback!
Just watched Brian W. Fitzpatrick and Ben Collins-Sussman’s Google I/O session, and I was very impressed. This talk is geared towards engineers/developers who have made the transition to management, be it through a promotion, or “accidentally.” This really hit home for me, as I made this exact transition at AE a while back. There are definitely some awesome concepts in here, definitely worth an hour of your time.
This is pretty awesome. Google recently made the apps script available to the public, and people have already been doing some sweet things. For one, you can now play Six Degrees of Kevin Bacon in Spreadsheets, which I’m sure is something you’ve always yearned to do.
To do it, just go to Insert – Script…
Under there, is a list of current scripts available that users have added to the scripts gallery. There are some pretty cool ones, but KB easily takes the cake, at least at the current time. Install the KB script, and head back to your spreadsheet. Here is an example formula to get you started:
=kb("Miley Cyrus", "Arnold Schwarzenegger")
I realize that SF is America’s sweetheart right now, despite his being a dick. Aside from that, however, his work is pretty fantastic. I’m sure you’ve all seen the recent outpouring of his outdoor work in Pittsburgh, but if you haven’t check out one of the spots below:
View Shepard Fairey Outdoor Work (Pittsburgh) in a larger map