Re: [twitter-dev] @Anywhere tweet box performance issue

2010-04-28 Thread Steve Brunton
On Wed, Apr 28, 2010 at 5:32 AM, Adi aditya.sa...@gmail.com wrote:
[..snip..]

 This whole thing takes quite some time (15 seconds) for the first
 time to display the tweet box. In subsequent calls this thing is as
 fast as expected.

 The wait between pressing tweet and watching the tweet box appear
 for the first time when someone presses tweet is extremely long, and
 almost entirely taken up the anywhere function call (I checked with my
 ajax call - doesn't take any time).


Do you have Speed Tracer
(http://code.google.com/webtoolkit/speedtracer/) or Firebug installed?
Can you see if the time spent is waiting on the request for the iframe
content to be returned from the twitter origin servers? If I had to
guess it's the response being slow returning and that's the delay that
you are seeing. We've got some World Cup stuff we are starting working
which is going to have @Anywhere on it so I'll have more experience
with it. Having gone through this with another companies Social Widget
launch recently I can tell you it's a crapshoot as to how quickly the
content renders in the browser.

-steve


Re: [twitter-dev] @Anywhere tweet box performance issue

2010-04-28 Thread Abraham Williams
You could probably start loading the TweetBox immediately on first visit but
hide it with CSS so it is quick loading when a user actually clicks on the
tweet button.

Abraham

On Wed, Apr 28, 2010 at 02:32, Adi aditya.sa...@gmail.com wrote:

 Hi all,

 I've got this use case:

 I have a button, clicking which opens up a tweet box with text
 defaulted by my application. Here's how I've implemented:

 1. Have a tweet button.
 2. On clicking tweet, call javascript method showTweetBox which
  - 2.1 Makes ajax call to my application to fetch some text (default
 tweet text)
  - 2.2 on successful ajax calls this (copied and modified from
 @anywhere documentation)
 ---
 twttr.anywhere(function (T) {
T(boxid).tweetBox({
  height: 40,
  width: 480,
  defaultContent: msg, // this is my default text
 obtained through ajax call dynamically
  label: Tweet this video,
  onTweet: removeTweetBox
});
 ---

 This whole thing takes quite some time (15 seconds) for the first
 time to display the tweet box. In subsequent calls this thing is as
 fast as expected.

 The wait between pressing tweet and watching the tweet box appear
 for the first time when someone presses tweet is extremely long, and
 almost entirely taken up the anywhere function call (I checked with my
 ajax call - doesn't take any time).

 I understand this post has quite a few subjective elements (my
 browser, my net speed etc) but is there a way to speed up the
 anywhere call which replaces a div tag with the iframe
 containing the tweet box? Do you recommend some other way?




-- 
Abraham Williams | Developer for hire | http://abrah.am
@abraham | http://projects.abrah.am | http://blog.abrah.am
This email is: [ ] shareable [x] ask first [ ] private.