I miss the old Streetview

Recently I’ve been updating a site with some quite complex map related functionality from Google maps v2 to Google maps v3. All in all it has been straight forward and worth doing.

The one disappointment IMO has been Streetview – the old version was so much slicker. The new version is easier to implement, but that is as positive as I can be. I miss being able to click in the distance and zoom down the road; I miss the swoosh as you move from position to position; I miss built in Full Screen.

On the flip side we now the have API for static streetview images – I’ve been using Jamie Thompson’s brilliant work on getting static map images up until now, but it is time to move on.

Slightly irritating is the fact you need to convert old (v2) Streetview panorama locations (if you have them saved) to show the locations as static images or as saved Streetview panoramas.

To convert a v2 panorama to a v3 panorama:

  • ‘yaw’ has become ‘heading’
  • change the sign of ‘pitch’ e.g. -1.80999 becomes 1.80999
  • add 1 to your ‘zoom’ level

Speed matters

To my unending amazement, many people I’ve worked with simply don’t believe that speed matters as a factor in Search Engine rankings. I don’t understand why. It’s not like Google (and lets face it, we are talking about Google) are being coy about it. (see links)

When you work in an office with stupidly fast broadband, maybe you just forget? But you shouldn’t assume that the people looking at your websites do.

The bit that really bugs me is this peculiar ‘head in the sand’ attitude. It does take more than a few minutes of thinking to come up with any number plausible reasons why speed is important for Search Engine Optimisation (aside from the fact the Google say it is). Try it, take a few seconds to think.

For me though the reasons that scream out at me are User Experience and Money.

User experience

First off – I admit this isn’t really an SEO factor, is it? People are busy, they don’t want to spend valuable time waiting for a web page to load, at least I know I don’t. I have better things to do, and I’m not that weird.

But why would Google care? I can rationalise that they want people to look at Ads. And then click on them. Probably a good idea to make websites faster so people don’t get bored and do something else, or find the bit of content they are looking for before the ads have loaded (because the ads come last).

Time = Money

Google must index billions of pages per day. It stands to reason that the faster a site loads, the faster it can be indexed. I’m guessing that it costs about the same to run a server whether it is indexing million pages per day or 10 million – but if your business is based on data the faster you can chew through data the better – and therefore it also makes sense for Google to promote an internet that lets them index more, faster.

But we don’t have the time, it’s to hard…

No it isn’t. Of course, as with any work there is optimum point in terms of cost vs. benefit (and that will be different for every site).

My gut feeling (and I don’t have any firm evidence for this) is that speed becomes more important the more traffic you get. If you’re site gets 50 visitors per day, then in a sense it is what it is – what you need to focus on is link building and content. However if your site gets 5000 visitors per day, then the chances are you’ve got quality links and good content – so how do you improve? I think the answer is the speed and user experience.

A fast website either means no traffic, no load on your server, no pictures, no javascript – in short a bit of old school html text… or it if is a big site, it means you care. It means that you have taken the time to think about users, you’ve spent a bit of money on hardware or code. It means that you are a quality business and therefore it is a good bet that you have better quality data on your site. It means that people will pay more to be associated with your site.

How to make your site fast

Hell, that’s a bold statement. It’s different for everybody. Think about the usual suspects, too much JavaScript, un-optimised images, sloooow queries with no indexes.

There are a myriad of solutions, and you don’t have to have Prototype, Jquery and Mootools all running on the same page, choose a single framework at a time – you will be amazed.

  • Use a CDN.
  • Use a cache server like Varnish.
  • If you’re a bit lazy – try out mod_pagespeed (sometimes it’s fab, sometimes it’ll melt your server)
  • Be brave, leave the Apache comfort zone and use Nginx or Lighttpd
  • Use minify

Fringe benefits

Chances are you’ll end up using some kind of caching and you’ll start setting sensible expires headers for your static content. But just think you’ll never have to tell somebody at the end of the phone to clear their browser cache again. And remember, the client is not an idiot because their browser hasn’t magically detected that a style sheet or an image has changed, and the website they have paid for looks a bit rubbish.

(by the way I don’t always practice what I’ve just preached, but at least I feel bad about it)

http://googlewebmastercentral.blogspot.com/2010/04/using-site-speed-in-web-search-ranking.html
http://www.mattcutts.com/blog/site-speed/
etc.

XPath to the rescue. Again?

It’s odd. I don’t think about think about XPath from one month to the next. But once in a while, when my usual solutions have all come up blank. Ta-Da XPath to the rescue!

Recently as part of a site I was working on, the design basically required that I inject a block of content into a nested list (part of an elaborate menu actually) – bit of a fiddle because modifying the code that generated the list was not an option.

My first avenues of attack were just simple str_replace() and a regex replace, but I just couldn’t get it work consistently – there were two many variables – additional attributes, white-space etc. The two constants were that the code fragment validated as xhtml (hence xml) and I would always have a class that I could use as a hook.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
 
// $menu - fragment of html consisting of nested UL's 
 
$xml = simplexml_load_string($menu);
 
$nodes = $xml->xpath('//*[@class = "current"]');
 
if(!empty($nodes)){
 
	$nodes[0]->addChild('div', 'text_to_replace');
	$menu = $xml->asXML();
	echo str_replace('text_to_replace', $str, $menu);
 
} else {
	echo $menu;
}

//*[@class = "current"] finds nodes at any level with where the class attribute contains ‘current’.

node[0] is the first instance of a node with this attribute and inject some place-holder text.

$menu = $xml->asXML(); our modified list.

Hey presto!

Looking for stock photos?

To tell the truth I do very little design work. I always find it particularly irritating when my shockingly expensive credits expire before I have a chance to use them.

So it was very nice when earlier this I was offered the chance to try out Fotolia for 1 month for free. Ironically I was so busy that I didn’t get around to actually signing up for ages. Eventually I did though, and to be honest it’s great. The website is fast, the search is good, and most importantly there is an extremely wide range of images and illustrations.

Obviously this is a shameless plug, but the next time I need to buy any stock images, Fotolia is actually going to be the first place I look. Good images and very good value (particularly the vector stuff).

For bloggers et al there is also an info microsite http://fotolianews.com/.

Four pieces

It’s been a while since I exhibited anything, but I’ve got three new pieces and one old one in the summer show at the Redearth gallery (currently without a decent website unfortunately)