Archive for June, 2008

Caching in Firefox 3

Friday, June 27th, 2008

@tadej told me a few days ago at the Firefox 3 launch party that he had issues with the way caching is handled in Firefox 3. I didn’t have such issues myself but it reminded me that I didn’t change the caching behavior when I installed it. So yesterday I opened the preferences and found the caching options under Advanced / Network. I was not really surprised that the options for how the cache works were missing — you really don’t want your everyday Joe to change this stuff since it may affect the perceived speed of the browser.

Since this was probably just left out of the interface I opened about:config and filtered with cache which gave me a few entries. The most interesting one was browser.cache.check_doc_frequency. Unfortunately it has a numeric value with a hidden meaning. And I had no idea what that meaning is.

I googled the thing and found a mozillaZine article about it. It explains how it works — the property defines how often the browser checks for a new version of a specific file. The possible values are as follows:

0
once per session
1
everytime
2
never
3
when out of date (default)

The default is 3 which is not very good for development purposes when you want changes to take effect immediately. What you want is 1 which means that every request will go to the server every time. You’ll get many 304s but you’ll also get a 200 as soon as a file changes on the server. So I changed the value to 1 and now I’m a happy developer.

Zemanta Pixie

Firefox 3 Release Event 2008

Tuesday, June 24th, 2008

So I’ll be talking at Firefox 3 Release Event at Kiberpipa today. Feel free to come listen to the talks or just come to the party. If you can’t come you can watch the whole thing online (the link is likely to be available somewhere on the event page).

Firefox JavaScript hiccups

Thursday, June 19th, 2008

While I was testing the speed of some simple JavaScripts on my recently invented JavaScript speed testing ground I noticed a weird thing going on in Firefox. But let’s start at the beginning.

Mozilla FirefoxImage via WikipediaThe JavaScript speed testing I do is very simple. I take a user specified piece of code and eval it, then I take the name of the function to call and eval that which means I get a pointer to a function I need to call. I set the number of times I want the function to be executed and then I prepare the interval.

The testing takes place in a function that is called every second which should give functions enough time to do what they’re supposed to do the specified number of times. The time is measured by setting a variable to the current date (and time of course) and then the function is executed in a for loop specified number of times. Immediately after the loop the time is measured again and the difference is the time spent by the loop. To be able to validate the output of the function I assign whatever the function returns to a variable (all the variables are set up before any of this happens). So the code looks like this:

t0 = new Date();
for (i=0;i<times;i++) {
	r = fn();
}
t1 = new Date();

The first thing when doing such speed test is to run an empty test. What we want to know is how much the whole time measuring takes. It’s got something to do with the fact that as soon as you measure the time you change what’s going on and also the time it takes to do that. And the fact that we’ve got a loop, a compare and an assignement going on.

So I ran this function test(){} a 100000 times. Since it doesn’t actually do anything you’d expect to get small and very similar times. And you do. So the next thing was to try something that actually does something, like function test(){var a={b:1};}. I expected bigger times but still quite similar. And I got such times in all browser I tested except Firefox. At first I thought that it might be something with the operating system. Or the extensions. Or any other number of things that could delay a JavaScript. But after quite a lot of tests on other browsers and platforms I’m quite sure that Firefox is the one to blame.

I tested Firefox 2 and Firefox 3 and both have the same problems. The only difference being that Firefox 3 has bigger problems — the times go up by 3-4 times the normal time, while in Firefox 2 I only saw a 2 times increase. I should mention that the biggest time in Firefox 3 (even with the increase) was still smaller than all the Firefox 2 times. What I did find out is that Firefox is a completely unreliable browser for speed testing. I have no idea what’s causing this but I’d really like to know. Anyone?

And while am at it — with Firebug 1.2 and all the panels on the times were about 3 times slower on Firefox 3.

Zemanta Pixie

Review: Adria Airways and NLB

Monday, June 16th, 2008

Recently two more big and very frequented Slovenian sites relaunched and I think they too deserve a mention.

Adria Airways

The first page I want to put to the test is the new page of the first and the biggest Slovenian airline. It was recently launched by my ex colleagues at Parsek as the second version to be made there. The first edition was designed and prepared in another agency and Parsek only did the backend while the new version is all Parsek. To be fair the biggest and the most important part — the reservation module — is still made by the french company Amadeus.

The new design tries to incorporate a leaner navigation with less elements even though it became wider, almost reaching the 1000px mark. The front page is much more sales oriented, displaying a lot of useful information. I can’t get past the color scheme that is really too dull. There are quite a few validation errors, the ones in HTML mostly due to non–escaped ampersands, while those in CSS are just sloppy coding without checking the validator.

I was surprised to see that some stuff doesn’t work well with Firefox 3 and Safari 3 even though the first one isn’t released yet (will be tomorrow) and the second one doesn’t have a lot of users in Slovenia. I’d still stick to what Yahoo! has to say in their Graded Browser support table for browser support.

I was positively surprised at how well some inside pages are designed down to the last dot and icon and negatively how bad the pages that “only” present CMS content look. I don’t know whose fault this is and I don’t even care, it doesn’t matter for the end user. I’m sure the guys at Parsek will check these pages out and try to make changes that will make them better. When I first saw the design while I was still at Parsek I wasn’t sure if the title on the right would work but now that I’m surfing the page I actually think it does. There is one problem there though – if you visit this page (screenshot) you’ll see that you can see its title “About us” four times in a very small area. It’s nice to know where you are but isn’t this a little bit too much?

NLB

The next big redesign is the biggest Slovenian bank which redesigned their site after quite a while. I don’t really know what to say about the redesign – the last one was horrendous so this one is easy on the eye. It too got wider and restructured so people can find relevant information easier. The home page lists all the products for residents and businesses so you can access them directly.

If the design got overhauled the backend didn’t — if it did it got it fashion tips from the 90s. Validation returns a lot of errors and — prepare for a shock — the encoding is iso-8859-2. The number of non semantic elements is significant and inline scripts are there too (<SCRIPT language=JavaScript>).

The most interesting thing about the new page is the fact that it now uses “friendly URLs”. And how utterly broken they are. You could also say this page is a textbook case for how wrong things can go when you don’t think about them. So you’ll have two pages, one at /nalozbe-v-vrednostne-papirje and the other at /nalozbe-v-vrednostne-papirje1. I have no idea how that tells you anything about how the content behind these links is different. It would tell you more if the first was prefixed with /residential and the second one with /businesses.

Another funny thing I noticed is how banners are designed to look as if they weren’t images but rather just HTML parts of the page. The reason I noticed is that I was on the Mac while checking the page and since font rendering is different it looks really weird. I think I might have seen the same difference on Vista with ClearType on.

Zemanta Pixie

Seed funding Slovenia

Sunday, June 8th, 2008

It’s happening. Slovenia is being put on the map of the internet.

The company is based in Slovenia and was funded through relationships it made at seedcamp. I am very interested in what’s going on with seed stage web startups in europe right now. I’ll be over there next month and will spend some time trying to get a sense of things. One stop is likely to be Slovenia to meet the Zemanta team.A VC, Jun 2008

Velika planina

Image via Wikipedia

I was fascinated when I read this post, not just because as most of you know I now work for Zemanta but also as somebody who has been trying hard to get people to think about seed funding Slovenian companies and organized two Start-up nights at Spletne urice for the same reason.

Unfortunately VCs in Slovenia still aren’t up to the task. And after all the great local companies get funded by foreign capital the local press will most probably say how we sold out everything of value.

Zemanta Pixie

eboran – esrevni

Saturday, June 7th, 2008

Today I wrote a quick funny script that inverses the text in all the text nodes on a page. I think it’s funny enough to release it:

function fcc_text_reverse(e){
	var j=(e.childNodes)?e.childNodes.length:0;
	for(var i=0;i<j;i++){
		var n=e.childNodes[i];
		if(n.nodeType==1){fcc_text_reverse(n);}
		else if(n.nodeType==3){
			n.nodeValue=n.nodeValue.split('').reverse().join('');
		}
	}
};
fcc_text_reverse(document.getElementsByTagName('body')[0]);

You can also use the favelet / bookmarklet — just drag Reverse text to bookmarks.

Zemanta Pixie