static.html

— a blog about web development and whatnot by Steve Webster

  1. Caching and the Google AJAX Libraries

    The Google Libraries API is a shared CDN for popular JavaScript libraries. The theory is that the more sites that load their JavaScript libraries via these shared URLs, the greater the chance of a visitor arriving at a given website with a fresh version of the required libraries in their browser cache. That's nice in theory, but how well does that translate to the real world?

  2. Use mod_rewrite’s proxy flag with caution

    Using mod_rewrite, it’s possible to proxy requests onto other servers by adding the P flag to your RewriteRules. This is a common technique to have Apache acting as the public-facing server for a number of disparate services. However, unless you’re careful with how you craft your rewrite rules, it’s possible for an attacker to gain access to your internal network or use your server to anonymously attack another.

  3. Firefox doesn’t hoist function declarations in blocks

    At work we include a third-party JavaScript library on our pages so we can run A/B and multivariate testing, and this code requires at least jQuery 1.4.0. Unfortunately we have more than a few dark corners of our site that are still dependent on an old (1.2.x) version of jQuery, so I had to find a way to detect the version of jQuery and not invoke the A/B testing code if we didn’t have the appropriate version. This proved to be more complicated than I thought, thanks to the way Firefox (actually SpiderMonkey) handles function declaration in blocks.

  4. ie6countdown.com – a wolf in sheep's clothing

    It seems that Microsoft are just as sick of users sticking with IE6 as web developers are, if their latest ie6countdown.com venture is anything to go by. You'd think that web developers – at least the ones who haven't already abandoned support for IE6 – would get behind this movement in their droves, and they may… but at what cost?

  5. HTML5 link prefetching severely broken in Chrome

    Link prefetching should be a relatively simple technique that web developers can use to improve the performance of their pages. Unfortunately, a crippling bug in Chrome means that using technique will result in your users being served up a broken page.

  6. Use unique IP addresses for sharded asset hosts

    One of the golden rules for front-end performance optimisation — one recommended by both Yahoo's YSlow and Google's Page Speed — is to split your page assets across multiple hostnames to allow web browsers to download more of those assets in parallel. Unfortunately it turns out that some consumer-grade network devices will block traffic to sites that use these techniques if the asset hosts all have the same IP address.

  7. mod_rewrite based on query string parameters

    mod_rewrite is an awesome tool that makes it easy to provide clean URLs or for setting up permanent redirects from legacy URLs to new ones, but rewriting based on an incoming query string is a little more complicated. The trick is to use a RewriteCond to match the query string portion of the URL, and a regular RewriteRule to match the path.

  8. HTML5's <video> is perfectly usable, thank you very much

    The HTML5 specification explicitly allows browsers to ignore the autobuffer attribute on media elements such as <audio> and <video>, and some browsers auto-buffer content regardless of whether this attribute is present. Is this a case of the specification being too pragmatic, and if so what can be done to improve the situation?

  9. The HTML class attribute

    I often hear developers refer to the “css class attribute”, something that to my knowledge doesn't actually exist. There is a class attribute in HTML, but there's much more you can do with that than just make your content look pretty.

  10. HTML5's <cite> element: what is it good for?

    I've been guilty of taking the <cite> element for granted, but what would a future with a more restrictive <cite> element be like, and is it the kind of future we really want our children to grow up in?

  11. Welcome to static.html

    Procrastination begone! Fed up not having a suitable outlet to write about standards-based web development stuff, I finally decided to so something about it. Ladies and gentlemen, I give you static.html.

  12. The problem with SproutCore

    SproutCore, one of a new breed of web application frameworks, brings desktop-like application user interfaces to your web browser, but is painting with <div> elements really where we want to be heading?