Engineering and Developers Blog
What's happening with engineering and developers at YouTube
Modifying Chow-Down Part 2: Make it Faster!
Tuesday, April 21, 2009
As promised in the
previous blog post
, I was given the task of making our
Chow Down Gdata
sample a little faster. It would sometimes take a while to load restaurant information due to the requests to YouTube and Picasa Web Albums taking a while to be processed on the backend. Since this would cause the user to sometimes see a "loading" bar for several seconds; something had to be done.
Originally, the application used the Python client library to retrieve information from YouTube and PWA and then stored it inside of memcache. The new solution is to instead retrieves these feeds directly in the browser using the
json-in-script support
of the Google Data APIs. This approach worked well for the Chow Down application since we were not retrieving any private information for use in this application and so did not need to authenticate as a user.
Another benefit of using the JSON feeds is that the browser can asynchronously request results from both YouTube and PWA at the same time and render the results as soon as they are returned. This helps decrease the "perceived load time" that the user experiences since they are seeing information start to be loaded instead of just watching a progress bar.
The code for the entire sample is available on code.google.com:
http://code.google.com/p/gdata-samples/source/browse/trunk/chow-down-gdata/
But you can see all of the logic for retrieving the feeds using JavaScript in the ajax_restaurant_info template:
http://code.google.com/p/gdata-samples/source/browse/trunk/chow-down-gdata/src/templates/ajax_restaurant_info.html
The code makes use of the
jQuery JavaScript library
in order to remain compact and compatible.
So if your site is using the Data APIs of one or more Google properties and you don't need authentication, considering switching to the JSON feeds to improve perceived latency and let your pages load the AJAXy way.
No comments :
Post a Comment
Labels
.net
acceleration
access control
accessibility
actionscript
activities
activity
android
announcements
apis
app engine
appengine
apps script
as2
as3
atom
authentication
authorization
authsub
best practices
blackops
bootcamp
captions
categories
channels
charts
chrome
chromeless
client library
clientlibraries
clientlogin
code
color
comments
compositing
create
curation
custom player
decommission
default
deprecation
devs
direct
discovery
docs
Documentation RSS
dotnet
education
embed
embedding
events
extension
feeds
flash
format
friendactivity
friends
fun
gears
google developers live
google group
googlegamedev
googleio
html5
https
iframe
insight
io12
io2011
ios
iphone
irc
issue tracker
java
javascript
json
json-c
jsonc
knight
legacy
Live Streaming API
LiveBroadcasts API
logo
mashups
media:keywords keywords tags metadata
metadata
mobile
mozilla
news
oauth
oauth2
office hours
open source
partial
partial response
partial update
partners
patch
php
player
playlists
policy
previews
pubsubhubbub
push
python
quota
rails
releases
rendering
reports
responses
resumable
ruby
samples
sandbox
shortform
ssl https certificate staging stage
stack overflow
stage video
staging
standard feeds
storify
storyful
subscription
sup
survey
tdd
theme
tos
tutorials
updates
uploads
v2
v3
video
voting
watch history
watchlater
webvtt
youtube
youtube api
youtube developers live
youtube direct
ytd
Archive
2015
December
November
October
May
April
March
January
2014
October
September
August
May
March
2013
December
October
September
August
July
June
May
April
March
February
2012
December
November
September
August
July
June
May
April
March
February
January
2011
December
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
July
June
May
April
March
February
January
2009
November
October
September
August
July
June
May
April
Modifying Chow-Down Part 2: Make it Faster!
Modifying the Chow-Down Application, part 1: Addin...
Latest Release Notes: Playlist Search, Time, and More
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
2007
December
November
August
June
May
Feed
YouTube
on
Follow @youtubedev
No comments :
Post a Comment