EllisLab text mark
Advanced Search
     
Twitter Timeline causing page not to load during Twitter outage?
Posted: 22 June 2012 05:37 AM   [ Ignore ]
Avatar
Joined: 2008-12-08
239 posts

I’m using the Twitter Timeline plugin (on both EE1 and EE2 sites) and during yesterday’s Twitter outage I found that site pages using it failed to load at all.
The plugin was usually used on the home page, so that meant that the site home page would be slow to load and eventually just show a white screen i.e. it gave the impression that the whole site was down.

Are there particular parameters / tags I should use to ensure a more graceful failure when there is a Twitter outage?

The typical parameters used were

twitter_refresh="30" cache="yes" refresh="30" 
and sometimes
use_stale_cache="yes" 
 Signature 

Janine
Tidy freelance web development | Pro Network member

 
Posted: 25 June 2012 03:22 PM   [ Ignore ]   [ # 1 ]   [ Rating: 0 ]
Avatar
Joined: 2011-11-25
7174 posts

Hey Janine,

I am sorry you ran into this.

use_stale_cache=“no” should have stopped that. When the API is not reachable, this tag tells the Add-On to just sit tight and wait. Are you saying that this is not that case? If so, we may need to look into filing a bug.

Please let me know.

Cheers,

 Signature 

Recent version: EE 2.5.4 | Forum Module 3.1.10 | MSM 2.1.4 | 2.x Bug Tracker | Version Upgrade

 
Posted: 26 June 2012 05:04 AM   [ Ignore ]   [ # 2 ]   [ Rating: 0 ]
Avatar
Joined: 2008-12-08
239 posts

Hi Shane,

We were either not using this parameter at all (I’m not sure which value it defaults to) or were using use_stale_cache = “yes”.

I thought the use_stale_cache parameter was about what action was taken after the api could not be reached i.e. whether to show old data cached locally or just show nothing.
How will this parameter actually prevent the plugin hanging indefinitely waiting for the api which is what seems to have happened preventing any of the page from loading at all?

 Signature 

Janine
Tidy freelance web development | Pro Network member

 
Posted: 26 June 2012 09:02 AM   [ Ignore ]   [ # 3 ]   [ Rating: 0 ]
Avatar
Joined: 2007-08-29
48 posts

I have also run into this issue, however the really strange thing it that is only prevented the page from loading in Chrome. All the other browsers just didn’t display the tweets.

I don’t understand this as it’s a server side problem.

 
Posted: 26 June 2012 04:55 PM   [ Ignore ]   [ # 4 ]   [ Rating: 0 ]
Avatar
Joined: 2011-11-25
7174 posts

Hey all,

Let me talk with one of the Devs and get back to you, something seems like it’s not quite right here.

Cheers,

 Signature 

Recent version: EE 2.5.4 | Forum Module 3.1.10 | MSM 2.1.4 | 2.x Bug Tracker | Version Upgrade

 
Posted: 12 July 2012 06:26 PM   [ Ignore ]   [ # 5 ]   [ Rating: 0 ]
Joined: 2010-05-03
4 posts

Hi Shane,

Were you able to talk with the dev regarding this issue? We just ran into the exact same problem today. Our homepage which uses the Twitter Timeline is not loading at all starting this afternoon.

Thank you.

 
Posted: 13 July 2012 01:14 AM   [ Ignore ]   [ # 6 ]   [ Rating: 0 ]
Avatar
Joined: 2012-07-11
97 posts

I would really recommend that you guys push developers and add-on to ensure any external JavaScript is lazy/defer loaded.

Google best explains why: https://developers.google.com/speed/docs/best-practices/payload#DeferLoadingJS

We’ve been using http://labjs.com/ for our client sites for months, and while it’ll take a couple of minutes to get one’s head around it by defer loading and lazy loading scripts you’ll see *huge* speed improvements and when an external provider of JavaScript (Twitter, Google, etc) are down then it doesn’t take your site down with it.

 Signature 

Michael - TotalServe, Australia. High performance ExpressionEngine hosting.

Need help, affordably? We offer Pay-what-you want ExpressionEngine support.

 
Posted: 13 July 2012 05:37 PM   [ Ignore ]   [ # 7 ]   [ Rating: 0 ]
Avatar
Joined: 2002-05-20
12626 posts

Hey all, Shane asked me to take a closer look and I can’t replicate on my end.  If I ensure the connection can’t be made, it simply outputs either nothing inside the tags or the cached data, depending on settings.  It’s definitely not a js issue- at least not natively, as the plugin doesn’t use js at all. 

For folks how have this happening:
1. Does the page continue to try and load forever, or is it loading fast to a blank white screen (suggests a PHP error);
2. Everyone running the latest version - Version 1.4.5?
3. Can anyone confirm it only happens in Chrome?  Because yes- that’s… I’d say impossible, except nothing is impossible.

If it’s still doing it- what happens if you ftp in and delete system/expressionengine/cache/twitter_timeline_cache/ and reload?

 

 Signature 
 
Posted: 16 July 2012 04:59 AM   [ Ignore ]   [ # 8 ]   [ Rating: 0 ]
Avatar
Joined: 2008-12-08
239 posts

Hi Robin,
To answer your queries:
1. page tries to load for a good while
2. affected sites were using a variety of versions on both EE1 and EE2 but several were running the latest plugin version 1.4.5 on EE2.
3. it was a problem in all browsers - basically it had the effect of the site home page appearing to be down

This was only a problem during the twitter outage in June, but I had not tried deleting the cache at the time.

I am anxious to find a workaround for this because several sites I have built use twitter timeline and usually it’s on the home page and it’s too risky having a plugin that takes down the home page when twitter has an outage (and many people will therefore assume the whole site is down). It’s not important whether the twitter part of the page goes blank or uses stale data, I just want the page it is used on to still be available when twitter goes down.

 Signature 

Janine
Tidy freelance web development | Pro Network member

 
Posted: 16 July 2012 12:41 PM   [ Ignore ]   [ # 9 ]   [ Rating: 0 ]
Avatar
Joined: 2002-05-20
12626 posts

That helps a lot, tidy.  Here’s what I’ve done that I think should fix it.  I added a parameter (time_limit) so you can specify how long the plugin allows for trying to connect to twitter and retrieve data- it’s up on github now for 2.x. 

So if the plugin gets no response in that amount of time (defaults to 5 seconds), it gives up and either serves from cache or blanks the tag. 

Sound like that will address the problem?  Like I say- I couldn’t replicate it.  But if the page was just sitting there trying to load forever, I strongly suspect this will fix it.

 Signature 
 
Posted: 16 July 2012 12:57 PM   [ Ignore ]   [ # 10 ]   [ Rating: 0 ]
Avatar
Joined: 2008-12-08
239 posts

Excellent - many thanks for this Robin! smile Great to have a fix for this which hopefully will prevent further trouble.

 Signature 

Janine
Tidy freelance web development | Pro Network member

 
Posted: 17 July 2012 01:33 PM   [ Ignore ]   [ # 11 ]   [ Rating: 0 ]
Avatar
Joined: 2011-11-25
7174 posts

Hey all,

The amazing Robin saves the day! I love our development team.

Is there anything else we can help with?

Cheers,

 Signature 

Recent version: EE 2.5.4 | Forum Module 3.1.10 | MSM 2.1.4 | 2.x Bug Tracker | Version Upgrade