archives

Posts tagged Firefox

Recently I spent quite a long time tracking down a very unusual bug on a WordPress site I was coding up. I had installed the very handy WP-PostViews plugin, and was double checking I had installed it correctly by loading a post and watching the post counts go up.

Yet the strangest thing was happening – not only would the post I was currently viewing increase, but another post had its count going up as well!

Several hours’ debugging later I noticed the problem was only happening in Firefox, and narrowed down the problem, confirmed by another Web Developer’s blog post. WordPress by default adds various lines of code into the header of your website, including <link rel="prev"...> and <link rel="next"...> links, pointing to the previous and next blog entry from the one you are viewing. As of Firefox 3.5, anything found in a <link rel="next"...> tag will automatically be “prefetched”.

The benefits? If a user is browsing through several blog posts, the posts will appear to load much faster than normal (as Firefox has already downloaded it for you).

The downsides? Nearly everything else. The WP-PostViews will have inaccurate post counts. Other forms of tracking may also be affected (though javascript-based tracking methods like Google Analytics are not affected). Sites with a huge number of visitors where any performance optimisation is vital are badly affected – the load on your server is doubled when viewing a single post. Could there be side effects with caching plugins? Perhaps. And I’m sure the list goes on.

The solution? Simple – just add the following code to your functions.php theme file:

remove_action('wp_head', 'adjacent_posts_rel_link_wp_head');

or, for a version of WordPress before 3.0:

remove_action('wp_head', 'adjacent_posts_rel_link');

I will be doing so for all websites from this point onwards.

Managing bookmarks tip

May 17 2006
by Rachel

Tagged

I’m sure you’ve all learnt this well before me but I recently had someone look at my browser and say, “wow, cool how did you do that?” Aside from using delicious, it’s nice to have the most popular sites you go to sitting right there in your browser on your bookmark toolbar.

The problem was, I was getting too many bookmarks on my toolbar. So, I started removing the site titles from the toolbar and made them as short as possible. For sites which had favicons, I’d remove the title completely from my toolbar. The problem was, lots of sites didn’t have favicons, so I couldn’t remove those titles completely.

I hunted around on the Firefox extensions site for something which would let me pick a custom favicon for these sites but the favicon picker there was for an old version of Firefox and wouldn’t work on 1.5.x. I hunted around to see if there was an update and found one in the Mozilla forums. Once installed I was able to just have little icons on my bookmarks toolbar:

Screenshot

Elsewhere: Skype MSN Messenger Twitter Facebook