Part 3 - Advanced Topics
Alex Russell
OSCON
July 24th, 2007
- Accessibility
- Optimization
- On the wire
- In the browser
- Cross-Domain Ajax
- It's possible to make accessible Ajax UI's
- It's not easy
- But it's getting easier
- Focus
- Feedback
- "What Is It?"
- Large-text modes
- High-contrast mode
- "Large-target" modes
- Colorblindness
- Other Section 508
- Defines richer set of what something "is"
- Must live in XHTML 2 namespace
- Needs to be set at runtime
- Calling
focus() almost well supported
- Setting up keyboard accellerators is difficult
- Dijit Widgets fully a11y hinted
Ajax a11y Is Hindered By Lack Of "HTML Subclassing"
Optimization
- Bandwidth
- Latency
- Parallel or Serial?
- Safari 3 Web Inspector
- Firebug
- Ethereal
- Server logs
- Cache
- Make it smaller
- Request fewer resources
- Parallelize
- Delay loading
- Host closer to endpoint
- Client side
- Server side
- Squid
memcached
mod_cache and physical partitions
- Database tuning
- gzip encoding (
mod_deflate)
- White space and comment removal (then cache!)
- Dead code stripping
- Concat smaller JS into larger "common" files
- CSS background image "trick"
- Exotic MIME games
- JS files are loaded serially
- 2 connections per domain!
- Host static resource "off domain"
- Sub-domains count
- CDN's help
- Load code in response to user actions
- Requires careful development practices
- Or a package system
- Dojo provides such a system
- CDN's
- Exotic form of caching
- AOL hosts Dojo in their CDN for all to use
- Tools much less mature
- Firebug profiling
- Custom test harnesses
- Hard-won experience with various rendering engines
innerHTML fast vs. DOM
- JS iteration is slow
- JS regular expressions are slow
- JS function calls are fast but not free
- IE GC "wall" (for now)
- "First visit" hit
- "Closures cause memory leakage"
- "DOM iteration is slow"
- "External style sheets are faster"
- "Objects are cheap"
- "Array joins are faster than string addition"
- Never guess
- Starting from the top and work down to slow components
- Keep a log
- Know when to stop
- If it's not what your clients are using, it's not what your clients are using
- Leakage !== Peak Memory Usage Increases
- Local data can be more interesting when given context
- Mashups do this in an ad-hoc way
- Better understanding of techniques will drive adoption
- Pioneered by James Burke of AOL (Dojo committer)
- Requires explicit cooperation of 3rd-party domain
- Can return HTML document content
- Few worries about malicious content or cookie leakage
- May be slow
- Proposal from Bob Ippolito
- Requires explicit cooperation of server
- Very fast, can return content of arbitrary type and size
- Variant already in use by Yahoo
- Potentially unsafe, executes remote code in page context
- IBM SMash
- Microsoft "SubSpace"
<module> tag proposal
- Whatever Gears does
- http://flickr.com/photo_zoom.gne?id=184612846&size=o
- http://flickr.com/photos/myradphotos/3111332/