Welcome to WebmasterWorld Guest from 54.196.232.162

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

Defer for php

     
5:29 pm on Apr 12, 2012 (gmt 0)

Preferred Member

5+ Year Member

joined:Aug 30, 2007
posts: 559
votes: 3


I have a php script that brings in a search box (and results) from an external website... a problem arises when the external website is down for maintenance and my website takes 'forever' to load while it is waiting for the php script... (which won't run) is there a 'defer' equivalent for php so that the page will at least load without the search box php query

Any suggestions on how to resolve this?
10:38 pm on Apr 12, 2012 (gmt 0)

Senior Member

WebmasterWorld Senior Member 5+ Year Member

joined:Apr 30, 2007
posts:1394
votes: 0


If you're connecting say with fsockopen or curl you can specify a timeout for the request. If you don't specify anything the default is something like 30secs. So you could change it to be few secs instead.
12:25 am on Apr 13, 2012 (gmt 0)

Administrator from US 

WebmasterWorld Administrator incredibill is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Jan 25, 2005
posts:14624
votes: 88


Another thought might be to put this content in an iframe, so then your page load speed would seem snappy and their content, however slow or even a timeout, wouldn't impact the rest of your page.
12:37 am on Apr 13, 2012 (gmt 0)

Preferred Member

5+ Year Member

joined:Aug 30, 2007
posts: 559
votes: 3


But surely iFrames are not good with search engines?
2:07 am on Apr 13, 2012 (gmt 0)

Administrator from US 

WebmasterWorld Administrator incredibill is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Jan 25, 2005
posts:14624
votes: 88


You said it was a search box from an external website, so I assumed that content wasn't your actual content and having it indexed opposed to pages load speed wasn't a primary concern. If I'm wrong, then other timeout limiting solutions listed above would probably work better but page load time will always be a concern. Besides, these aren't your dads search engines, they can handle frame content unlike back in the day, but it's still not optimal results.

More importantly, aren't you concerned with dupe content by including a 3rd party sites search results or are the search results directly derived from your site?
10:01 pm on Apr 14, 2012 (gmt 0)

Preferred Member

5+ Year Member

joined:Aug 30, 2007
posts: 559
votes: 3


Thanks incrediBill.. the off-site content is taylored for my site and comes from a database... the alternative is to bring the content in via xml... every day and usually in the early hours of the morning in my time zone (but we sell world-wide)the php content goes off-line for a minute or two... but becoming more frequently is an extended period of being off-line which then slows down the loading of my site considerably.
10:01 pm on Apr 14, 2012 (gmt 0)

Preferred Member

5+ Year Member

joined:Aug 30, 2007
posts: 559
votes: 3


Thanks incrediBill.. the off-site content is taylored for my site and comes from a database... the alternative is to bring the content in via xml... every day and usually in the early hours of the morning in my time zone (but we sell world-wide)the php content goes off-line for a minute or two... but becoming more frequently is an extended period of being off-line which then slows down the loading of my site considerably.
10:43 pm on Apr 14, 2012 (gmt 0)

Preferred Member

5+ Year Member

joined:Aug 30, 2007
posts: 559
votes: 3


Could an "Object" be used to contain this php external content? and would that then load AFTER the page load?