News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Slow SSI. Loading Page Addition?

Started by ldk, November 10, 2004, 10:22:12 PM

Previous topic - Next topic

ldk

Hi.  Let me first just say that after many months of using SMF I just started to dabble in the SSI functionality ... and it is soooo amazing!  SMF Developers -- Thank you for making this feature and for making it so easy and powerful.

I'm using the SSI functionality to add some "forum stats" to the entry page of my site.  I'm showing how many members, last 5 posts, etc...

It's working.  But it's very slow.  So I guess I'm wondering if
(a) I might be doing anything wrong or if I should do something differently
or
(b) if it's just gonna be slow and there's nothing that can be done about this, can someone suggest a way that I can display perhaps a "loading animated gif" while that stuff loads

You can look at the page here and see how slow the php file (which contains the SSI functions) loads into the right hand frame:
http://www.craftster.org/index.html

Thanks for any advice you all may have!

Here's the code for the php file which contains the SSI function calls:


<?php
require("/home/craft/public_html/forum/SSI.php"); 
?>

<html>
<head>
<base target="_parent">
<style type="text/css">
BODY,P,TABLE,TD,TR {
  font-size: 9pt;
  color: #000000;
  font-family: Verdana, Helvetica, sans-serif;
}
</style>
</head>
<body bgcolor="F2E05A" text="#000000" link="005177" vlink="005177" alink="CC3333" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="100%" border="0" cellspacing="3" cellpadding="3">
  <tr>
    <td bgcolor="#FFFF99"><strong>Here's a snapshot of what's happening on the
      Craftster forum on right now.</strong><br>
      <br>
      <?php ssi_boardStats(); ?>
      <br>
      <br>
      <strong>The 5 Most Recent Messages Posted</strong><br>
      <?php ssi_recentPosts(5); ?>
      <br>
      <br>
      <strong>Top 10 Topics of Discussion by Views</strong><br>
      <?php ssi_topTopicsViews(); ?>
      <br>
      <br>
      <strong>Top 10 Topics of Discussion by Replies</strong><br>
      <?php ssi_topTopicsReplies(); ?>
      <br>
    </td>
  </tr>
</table>
</body>
</html>

see SMF put to the test at http://www.craftster.org/

[Unknown]

It seems to load quickly enough for me.  What version of MySQL are you running?

-[Unknown]

Kender

http://chucknorris2012.com  Avoid a roundhouse kick to the head!  Sign the petition

ldk

#3
Quote from: [Unknown] on November 11, 2004, 01:04:18 AM
It seems to load quickly enough for me.  What version of MySQL are you running?

-[Unknown]

MySQL 4.0.22-standard

I find that about 10% of the time it loads quickly but %90 percent of the time it takes about 5 seconds for that right-hand frame to fill in.

So if you go back and try again or reload it a few times, you'll see what I mean.  Is there something computationally intensive about displaying the information I've chosen to display?  Like do those "Top 10" lists get calculated on the fly every time someone loads the page?

see SMF put to the test at http://www.craftster.org/

Grudge

Loads fine for me. I refreshed it about 20 times (Ctrl + F5) and it was all grand. The pictures took a second at best to load and they were the last things it was waiting on.
I'm only a half geek really...

ldk

Hmm.  Maybe it's the browser I'm using?

I primarily use OSX.  And this long delay happens when I use IE and Safari.

Thanks so much for checking this for me.  Hopefully the overwhelming majority don't see the delay I'm seeing.

I don't suppose anyone wants knows of some HTML trickery I can use to display a loading animation in that frame until the php loads?  Just in case the problem is more widespread that we think.

see SMF put to the test at http://www.craftster.org/

A.M.A

Really sorry .. real life is demanding my full attention .. will be back soon hopefully :)

Grudge

What if you make a test page with just this in it:

<?php
require("/home/craft/public_html/forum/SSI.php"); 
ssi_boardStats();
ssi_recentPosts(5);
ssi_topTopicsViews();
ssi_topTopicsReplies();
?>


Does that *also* load up slowly for you? That would determine whether it's the SSI or another problem
I'm only a half geek really...

ldk

Yep.  I just made a PHP file here with just that code in it:

http://www.craftster.org/statstest.php

and it takes several seconds to load.  Very weird.

Anyone else here use OSX and want to check if that's the mitigating factor?
see SMF put to the test at http://www.craftster.org/

ldk

Quote from: A.M.A on November 11, 2004, 10:47:27 AM
http://www.dynamicdrive.com/dynamicindex4/preloadimage.htm
http://www.dynamicdrive.com/dynamicindex4/preloadimage2.htm

Those are interesting!  But I don't think they'll help here.

They're for preloading images and I think images are different from PHP files in that when they get loaded once, they're instantaneously ready to be used when needed.  I think that PHP files always get loaded anew every time they're asked for.  So if I preloaded the PHP in one page and then asked for it again right away, it would call for it all over again.

What I would need to to perhaps make some sort of graphic display over the frame with the PHP in it and then somehow make it disappear when the PHP is done loading.
see SMF put to the test at http://www.craftster.org/

Grudge

Ummm... interesting. Every so often I do get a long page load, and it's actually slower now than it was before. The "most popular topics" thing seems to be taking most of the time - still seems reasonable on just the php file for me (not great but reasonable).

Why not temporarily try taking out the two calls to:
ssi_topTopicsViews();
and
ssi_topTopicsReplies();

And see the effect on speed?
I'm only a half geek really...

[Unknown]

I suggest you upgrade the forum to the newest version, after which I can help investigate what may be slowing things down, if anything.

-[Unknown]

Advertisement: