10.16.09

Halloween Costume Ideas: Trimming down

Posted in Meta at 12 am

Each year at this time there is a significant spike in traffic on this site, mostly because of the Halloween Costume Archive. However I noticed that another page about an award winning costume on my blog was actually using a lot of bandwidth, way out of proportion from its hit count. It seems there was some weighty code hanging around in my WordPress template.

So I started digging into the raw HTML code that was being expressed and noticed that a huge amount of the text was dedicated to links for each month’s archives, stretching back to 1998. There was not only a series of links on the right-hand column, but also a set of META tags with the rel=”archive” attribute set that linked to each of them a second time. Now that we’re 10 years on for this journal, that’s 240 links with out much additional function. It seemed highly unlikely that readers would meticulously trawl through the archives using either of these methods. So I cut them out.

So while the the HTML weight of that single entry came in at about 45KB, I was able to drop it down to… (wait for it…)

18KB. That’s right! 60% of my page weight was coming from just these two sets of archive links. I’ve now 1) commented out the metatags created by this line of code: wp_get_archives(‘type=monthly&format=link’); that is inside the header.php file that came with my theme; and 2) I’ve replaced the previous Archive widget with a simple text widget where I’ve hard-coded a list of links to the yearly archives. I’ll now need to update that once a year, but I think I can handle such a task.

So there’s a lesson here: Check your view-source every decade to make sure you’re not overlinking yourself.

Hopefully, this weight reduction, combined with upgrading my bandwidth allocation 300% will keep my site under the bandwidth cap this year until November 1, when for some reason the traffic falls like a rock.

RSS feed for comments on this post · TrackBack URL

Leave a Comment