UA-Serve

UA-Serve delivers customized javascript files based on your browser's user agent. Traditionally, user-agent parsing has been very unreliable, but UA-Serve is different because nothing is actually parsed. Instead, a complete match of the entire user-agent string is made.

What's special about a serving a browser-specific javascript library? Smaller, faster files; whether it's for feature detection libraries like Modernizr, or for web shims and polyfills like Sizzle and Excanvas. Only the code that is needed for that particular browser is served.

UA-Serve also allows the creation of new browser-specific javascript files via feature testing, like those found in Modernizr. For example, if an initial feature test is downloaded and run on a Firefox 3.6 browser for Windows, then all future Firefox 3.6 browsers for Windows benefit.

<script src="uas.php?libs=modernizr-2.0.6,sizzle-1.5.1"></script>

In this example, we test for Modernizr 2.0.6 and Sizzle 1.5.1. Modernizr might regularly serve a 4.4 KB gzipped compressed javascript file, but once UA-Serve has its way, the user will receive a 0.5 KB gzipped javascript file - that's about 12% the regular file size. (Were there a Sizzle 1.5.1 test, this would also be run.) Multiple uncompiled and precompiled libraries can be run simultaniously.

You were served the following javascript. If it looks really long, refresh.


		
		
		

Awesome.

Based on the ideas of Jonathan Neal, Paul Irish, and friends!