Welcome to WebmasterWorld Guest from 35.172.217.40

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

Page displayed before formatting

2 identical sites, 2 servers, different results

     
5:19 pm on Feb 17, 2009 (gmt 0)

Preferred Member

10+ Year Member

joined:Jan 4, 2004
posts: 456
votes: 0


Just built two sites. On one the site delivers as expected. On the second site the text displays for a couple of seconds before the CSS formatting is displayed.

The only difference between the two sites is that the one that displays normal is on LAMP system (Linux, Apache, MySQL, and PHP). The other one is on SAY5. Both servers are owned and operated by the same hosting company.

The hosting company claims that SAY5's increased PHP security comes at a cost--the unformatted page display. They seem to think that this is okay since it happens only on the first page visited. Subsequent pages viewed do not have the non-formatted page flash.

Is there a way to force PHP to build the entire page--with CSS formatting--before sending it to the browser?

Has anyone run into this before?

Suggestions appreciated.

These are the web sites in question.

<snip>

[edited by: eelixduppy at 5:20 pm (utc) on Feb. 17, 2009]
[edit reason] no personal URLs [/edit]

7:38 pm on Feb 17, 2009 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month

joined:Oct 4, 2001
posts: 1277
votes: 17


From what I understand SAY5 isn't an operating system, it's hosting management software like CPanel or PLESK, so most likely both servers are LAMP.

The idea that under SAY5 PHP apps run differently is absurd. Whatever setting they have enabled that is causing this problem can just as easily be disabled.

Or if they won't disable it then they should move you to a server without the issue. Telling you it's ok for your website to display with no CSS formatting on the visitor's first pageview makes my top 10 list of worst tech support responses of all time.

BTW I can't think of any security setting that would cause CSS not to display the first time. Most likely whoever told you this didn't know what they were talking about.

7:50 pm on Feb 17, 2009 (gmt 0)

New User

10+ Year Member

joined:July 30, 2008
posts:14
votes: 0


Do the visitors only have an issue with one page on the site? If they land on any page in the site, will it do the same thing? If so, maybe you could add a header that parses each page prior to displaying and buffers the formatted php before its completely loaded and outputs it all after formatting.

[us2.php.net...]

The ideal situation would be to get the hosting company to quit being lazy, but in the mean time, this might be of service.

8:47 pm on Feb 17, 2009 (gmt 0)

Preferred Member

10+ Year Member

joined:Jan 4, 2004
posts: 456
votes: 0


The hosting company just sent me this email:

"We looked into that. PHP runs in Fast-CGI mode in Say5, Although Say5 allows us to run it under 9 different configuration, but we decided this mode for maximum security. In this mode implicit_flush flag seems to be ON by default, We've set that to OFF in server wide configuration file to make it buffer the output before sending every line to visitors. Seems to be working much better."

Any suggestion(s) on how to respond?

With this change the flash is shorter in duration. However, it still exist and is unacceptable.

Tatorface, good call. Yes, it is seems to be only on the initial page the visitor comes in on. When the site's other pages are visited there doesn't appear to a flash of unformatted content--at least for me. For others the flash appears on other pages as well.

IanKelley, they did not explicitly say the unformatted content is okay. Their actual response is that it is the result of 'necessary' security settings.

[My apologies to eelixduppy for including links to a personal web site. Forgot that it wasn't permitted.]

[edited by: Storyman at 8:50 pm (utc) on Feb. 17, 2009]

9:19 pm on Feb 17, 2009 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month

joined:Oct 4, 2001
posts: 1277
votes: 17


It's definitely not part of the "necessary" security settings but it doesn't sound like something they will be flexible on.

If you want to stay with this host, take a look at ouput buffering, as tator suggested. What I would do is buffer the entire <head> section of your document with CSS included and then double flush that to the browser before proceeding with the <body> section.

This should hopefully cause the CSS formatting to get loaded before the page display starts.

If you're using external CSS you may have to compromise and make it on page... At least for the first pageview. Although if it were me I'd just find a better host.

12:25 am on Feb 18, 2009 (gmt 0)

Administrator

WebmasterWorld Administrator coopster is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:July 31, 2003
posts:12555
votes: 3


doesn't appear to a flash of unformatted content

Are you familiar with FOUC [google.com] (flash of unstyled content)? That's what it sounds like to me.

2:28 am on Feb 18, 2009 (gmt 0)

Preferred Member

10+ Year Member

joined:Jan 4, 2004
posts: 456
votes: 0


Coopster,

Good call. It turned out to be FOUC. Changed from import to include and the problem went away.

Thanks

 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members