When is a stylesheet really loaded?

Often we want to load a CSS file on-demand by inserting a link node. And we want to know when the file finished loading in order to call a callback function for example. Long story short: turns out this is harder than it should be and really unnecessary hard in Firefox. I hereby beg on […]

March 17th, 2011
Tags: browsers, CSS, performance

Velocity online conference March 2011

Very rough notes from the event that just ended a few minutes ago ======== 1 ======== Tony Gentilcore (google) and Anderson Quach (MSFT) talked about the W3C working group and the specs for measuring performance: Navigation timing spec – HTML document: DNS, handshakes, load events Resource timing – how long JS, CSS, audio, video… take […]

March 15th, 2011
Tags: performance, tools

Automating HTTPWatch with PHP #3

The first part is here, the second is here. This third post is more about PHP and COM, rather than HTTPWatch or monitoring web performance, so feel free to skip if the title mislead you 🙂 Keep reading if you want to use and improve/update my HTTPWatch class in the future. The problem After running […]

March 7th, 2011
Tags: HTTP, performance, php

Automating HTTPWatch with PHP #2

In part 1 I demonstrated how you can use PHP to script and automate HTTPWatch. And how you can get data back, either reading the API docs or using a quick HAR hack to get a lot of data in one go. Now I want to share a little class I wrote to make all […]

March 7th, 2011
Tags: HTTP, performance, php

Automating HTTPWatch with PHP

HTTPWatch is a nice tool to inspect HTTP traffic in easy and convenient way and it works in both IE and FF now. Drawback – windows-only and paid. But the free version is good enough for many tasks. HTTPWatch can be automated and scripted which is pretty cool for a number of monitoring-like tasks. Their […]

March 5th, 2011
Tags: HTTP, performance, php

Command-line CSS spriting

(In Russian) OK, CSS sprite tools exist. I’m pretty confident I actually made the very first one 🙂 But they break from time to time (like mine currently). And then the command line is cool (as opposed to scary) and oh-so-quick. And imagemagick is cool and oh-so-powerful. So let’s see how we can create CSS […]

February 19th, 2011
Tags: CSS, images, smush.it

Another LOC

We don’t need no docum’ntation We don’t need no source control No dark sarcasm on the mail(ing) list Ninjas leave them kids alone No comments – code should speak alone! All in all it’s just another LOC We don’t need no code conventions We don’t need no (js)lint control No YSlow rules, no validation And […]

February 11th, 2011
Tags: Fun, Music

CSS railroad diagrams

So next step after the sexy CSS lexer is parsing. But first – railroad diagrams to help visualize how/when the tokens make sense forming valid CSS code. Below is what I have so far. It includes pretty much everything except selectors. Selectors are getting increasingly complex, come to think of it. There are probably mistakes […]

November 28th, 2010
Tags: CSS

CSS Lexer

I have so much stuff to do and I’ve been feeling a little overwhelmed lately. Not depressed, because it’s next to impossible to be depressed at a climate including 320 sunny days a year and a beach. So I thought why not drop everything and relax. I’m currently staying at home, enjoying my unused vacation […]

November 27th, 2010
Tags: CSS

CSS minifiers comparison

Last year I compared some CSS minifiers, namely YUICompressor, CSSTidy (with “small” vs. “safe” settings), PHP PEAR’s CSS lib and Minify (detailed results). Now that I’ve done some work on the YUICompressor and since there’s a new kid on the block from Microsoft I thought I should give it another go. I only compared CSSTidy […]

October 30th, 2010
Tags: CSS, performance, tools

cssmin.js in windows shell

JavaScript can run virtually anywhere, including as a windows exe and the windows command line. Say you have a JavaScript function foo() function foo(input) { var output = input; // .. unicorns return output; } In order to make this a windows shell script you add at the and a way to read standard input […]

October 29th, 2010
Tags: CSS, JavaScript, performance

Preload, then execute

I talked before about using an object element to load scripts and styles without executing/applying them to the current document. And this is nice for preloading assets – faster and less error-prone than simple inclusion if the document or iframe. But what about preloading assets (scripts) and then executing them on the current page? Turns […]

October 23rd, 2010
Tags: JavaScript, performance

Inline MHTML+Data URIs

MHTML and Data URIs in the same CSS file is totally doable and gives us nice support for IE6+ and all modern browsers. But the question is – what about inline styles. In other words can you have a single-request web application which bundles together markup, inline styles, inline scripts, inline images? With data URIs […]

October 3rd, 2010
Tags: CSS, HTTP, IE, images, performance

The proper MHTML syntax

Reducing the number of HTTP requests is a must, sprites are cool, but a pain to maintain, so there come data URIs (for all browsers) and MHTML (IE6 and 7). I’ve talked about these things on this blog to a point where the blog comes up in top 10 results in search engines for queries […]

October 3rd, 2010
Tags: CSS, IE, images, performance

The European Tour 2010

So it’s been pretty quiet around here. I’m still alive and very much so. Just awfully busy. Bulgaria I took a long trip in Bulgaria. About 1 month and 20 days. Including the traditional around-Bulgaria let’s-get-drunk-in-different-cities-every-day tour de force with the gang. With unusual amount of guitar playing this time. Not all fun and roses, […]

October 2nd, 2010
Tags: Bulgaria, JavaScript, News/personal, performance

JavaScript JS Array Documentation (#jsonf, #promotejs)

Join me in the initiative to promote proper JavaScript documentation from MDC. It’s embarrassing the quality of links that pop up in search engines when searching JavaScript general questions. Let’s help connect newcomers to JavaScript with better reading. PromoteJS.com will give you a unique code.

September 26th, 2010
Tags: JavaScript

Web Testing Framework

There’s a new version and now hosted on AMO (addons.mozilla.org). Get the new version there and it will take care of auto-updates in the future. WFT Web Testing Framework (WTF) is an extension to YSlow that tests for the following shady web dev practices: Use of <blink> Use of <marquee> Use of <font> Missing doctype […]

June 20th, 2010
Tags: tools, Web1.0, yslow

Conditional comments block downloads

I came across this blog post (via @pornelski and @souders) where Markus has stumbled upon a case where an IE6-only stylesheet included with a conditional comment blocks the downloads in IE8. Whaaat? I had to dig in. To give you a summary: turned out that any conditional comment, not only for an extra CSS, will […]

May 23rd, 2010
Tags: CSS, performance

YUI CSS min – part 3 – hacks

The previous parts are here (building and testing) and here (what gets minified). Now let’s see how YUI CSS min handles CSS hacks. As you know CSS hacks often use errors in CSS parsers in browsers to target specific browser versions and supply additional rules to work around other issues in said browsers. That makes […]

May 21st, 2010
Tags: CSS, performance, tools, yahoo, yui

YUI CSS Min – part 2

The first part is here. It was more about building the YUICompressor, writing and running test cases. Now let’s see what the compressor does exactly to your CSS. BTW, you can play with the web UI to see for yourself how the minifier works. Stripping comments and white space This is the bare minimum a […]

May 20th, 2010
Tags: CSS, performance, tools, yahoo, yui

Top 5 reasons to send your resume to Yahoo! Search today

Disclaimer: I work for Yahoo! Search. But I speak for myself. All opinions on my blog, twitter… yada-yada… are not necessarily those of my employer. They could be, but they may not be. They might have been but may no longer be. They might have never been, but maybe, baby, someday they might become. So […]

May 19th, 2010
Tags: yahoo

15 minutes could save you…

Since I have a ton of things to do, I decided it was about time to spend some time with this blog, performance optimization-wise. Not do anything special, just the bare minimum, the no-brainer, works-every-time, easy stuff. And I’m quite happy with the results. I only looked at the homepage, although the results will be […]

May 17th, 2010
Tags: CSS, images, performance, WordPress

10 more search results

Thought I should share a fun little greasemonkey script that puts twitter-like MORE button (hm, maybe should’ve named it MOAR 🙂 ) at the end of the Yahoo search results. Clicking the button gives you 10 more results without a page refresh. Neat. Download: userscripts.org and a 39 seconds demo…

May 14th, 2010
Tags: BOSS, misc hackery, yahoo

Browser sniffing with conditional comments

Browser sniffing is bad. But sometimes unavoidable. But doing it on the server is bad, because UA string is unreliable. The solution is to use conditional comments and let IE do the work. Because you’re targeting IE most of the times anyway. In fact IE8 is a decent browser for the most practical purposes and […]

May 13th, 2010
Tags: browsers, CSS, IE, performance

Preload CSS/JavaScript without execution

Preloading components in advance is good for performance. There are several ways to do it. But even the cleanest solution (open up an iframe and go crazy there) comes at a price – the price of the iframe and the price of parsing and executing the preloaded CSS and JavaScript. There’s also a relatively high […]

April 21st, 2010
Tags: CSS, images, JavaScript, performance