Part 3 - Advanced Topics
Alex Russell
EuroOSCON
Sept 18th, 2006
- 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
- As a result, needs to be set at runtime
- Calling
focus() almost well supported
- Setting up keyboard accellerators is difficult
- We're working on generalized a11y solutions in Dojo
Ajax Accessibility Is Hindered By Lack Of A Coherent Shadow DOM
Optimization
- Bandwidth
- Latency
- Parallel or Serial?
- 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
- Venkman profiler
- Lots of ad-hoc speed comparisons
- 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
- IE GC "wall"
- "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"
- Your first guess will be wrong
- Starting from the top and work down to slow components
- Always keep a log
- Know when to stop
- Always verify your cache settings
- If it's not what your clients are using, it's not what your clients are using
- Leakage !== Peak Memory Usage Increases
- Local data is interesting
- But it'll always be more interesting when given more context
- Mashups already do this, but protocol is opaque
- Better understanding of techniques will drive adoption
- Pioneered by James Burke of AOL (a Dojo contributor)
- Requires explicit cooperation of 3rd-party domain
- Can return HTML document content
- Few worries about malicious content or cookie leakage
- May be slow in some circumstances
- 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
- http://flickr.com/photo_zoom.gne?id=184612846&size=o
- http://flickr.com/photos/myradphotos/3111332/