Current time: 10-20-2019, 11:34 AM Hello There, Guest! (LoginRegister)

Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Facebook SPOF - how to prevent?
09-24-2010, 06:54 AM
Post: #1
Facebook SPOF - how to prevent?
Facebook was/is down for > last 1 hour... it caused problems for my site

http://www.webpagetest.org/result/100923...835ed4161/

I use iframe for the like/recommend widget. On my site, the story pages are cached on disk for months, so for now i replaced the facebook url with a dummy blank html page (using substitute module in nginx) to mitigate the SPOF until Facebook fixes their shit.

The question is... how to prevent this in the future? Any hacks around where i can load iframes in a manner such that their failure doesnt hold back the document.onload() from firing?

PS: PLS don't suggest getting rid of the Facebook widget . it gets me traffic Smile

cdnplanet.com: We help you select the right CDN
Visit this user's website Find all posts by this user
Quote this message in a reply
09-24-2010, 07:29 AM
Post: #2
RE: Facebook SPOF - how to prevent?
Can you populate the Facebook widget at onload? That would certainly do it (though it would delay rendering of the widget) :-)
Visit this user's website Find all posts by this user
Quote this message in a reply
09-24-2010, 07:40 AM
Post: #3
RE: Facebook SPOF - how to prevent?
(09-24-2010 07:29 AM)pmeenan Wrote:  Can you populate the Facebook widget at onload? That would certainly do it (though it would delay rendering of the widget) :-)

aha... thanks... makes sense.... i don't mind the 3 - 5 second delay in the facebook widget being populated (i think - would be worth doing ab testing on it)...

meaning something like this?

Code:
<div id="facebookwidget"></div>

and after onload

Code:
document.getElementById('facebookwidget').innerHTML = '<iframe src......>';

or is there a better way?

on a side note... facebook should use a cdn served static file for the base iframe page... and then the iframe should load the dynamic stuff via ajax call.

cdnplanet.com: We help you select the right CDN
Visit this user's website Find all posts by this user
Quote this message in a reply
09-24-2010, 08:30 AM
Post: #4
RE: Facebook SPOF - how to prevent?
That would probably work but might be cleaner to include the empty iFrame and then just set the src as part of the onload: http://www.cryer.co.uk/resources/javascr...singIFRAME
Visit this user's website Find all posts by this user
Quote this message in a reply
09-25-2010, 12:50 AM
Post: #5
RE: Facebook SPOF - how to prevent?
Realized this issue is bigger than i suspected
see http://www.webpagetest.org/result/100923...1/details/

I have the tweet button on all my pages also (loading them async but not deferring them) . Since china blocks twitter, so all pages which uses the tweet button(or facebook like widget) will fail. Even worse consequences if they load it synchronously as the docs suggest.

Deferring 3rd party stuff is a workaround, but not a nice one.. In some cases the user may already finish "scanning" the story before the sharing widgets come to life...

China is not a major target for me, but each click counts. Moreover, if universities/corporate networks blocks these sites, our pages would also suffer similarly... Need to find some better solution to these issues than deferring their loading...

Sidenote: TribalFusion ad network also seems to be blocked in China...

cdnplanet.com: We help you select the right CDN
Visit this user's website Find all posts by this user
Quote this message in a reply
09-25-2010, 01:18 AM
Post: #6
RE: Facebook SPOF - how to prevent?
I guess it largely depends on what your page does. If you don't have any code attached to onLoad then loading the widgets asynchronously is probably the best way to do it because they will load quickly in the normal case and not block any of your actual page functionality (though the user will see the page "loading" until everything fails).

If you do have logic you care about attached to onload then things get trickier because these failures actually push that out and you have a SPOF again (just not for the page content). Would be great if there was a way to async load during the page load and make that content not block the onload but I'm not aware of any reliable ways to do it.

I hadn't thought about the pathological case of things being broken because of the great firewall but that could actually be a pretty big deal for a lot of the web.
Visit this user's website Find all posts by this user
Quote this message in a reply
09-30-2010, 06:15 PM
Post: #7
RE: Facebook SPOF - how to prevent?
Ok... found a solution for iframes

http://stevesouders.com/efws/iframe-onlo...ocking.php

Does not need to be differed to after onload.
Does not block onload event

cdnplanet.com: We help you select the right CDN
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)