Get even: live long enough to be a problem to your kids.
‹anonymous›
Atlantis: the domain of the Stingray
14Oct
2005
Fri
21:23
author: Stingray
category: My Ramblings
comments: 1
[GRAV]
Windows XP Mozilla Suite (5.0)
Geoffrey
23Oct2005/20:45
[12.218.199.147]
trackbacks: 0

Why is the Page Loading so Slow?

The short answer is that I'm working on something. That thing that I'm working on doesn't exactly run quickly, though I'm searching for ways to speed it up. Also, I'm showing it off to other users of this blogging 'ware, should they be interested in its functionality or even if they have a way to improve it.

If you're wondering what exactly I'm talking about, read on. If what I have said thus far—I'm experimenting with something—is a good enough answer for the question, then read on only if you want more info.

Favicons...

Many sites have them. Atlantis is one of them. Do you see that little icon next to this site's url (up in your address bar). It looks like this site's logo (in fact, it is). It's simply a web master's trick to place a the site logo somewhere else.

Anyway, what I've done is hack through part of Pivot's script to include those favicons next to the title in the Last Referrers section. Unfortunately, going through all the code can be tedious and time consuming, even for PHP code. The reasons are varied.

First, this is a PHP script trying to act like a web browser. It tries to get information from another web page. You know how long it can take for one web page to load normally, well, multiply that by 10 or 11, now this page takes that long to load (because it's trying to load that many more web pages at the same time, only to get a small amount of information.

Second, while the item itself is called a favicon, there is no naming standard for it. Case in point would be Atlantis and famwagner.com. Here, at atlantis, I call the icon file atlantis.ico. At famwagner.com, it is called wagnerfamily.ico. Many sites stick to the name favicon.ico, since that is what most crawlers and robots will look for; Mrs. Wagner's Neighborhood uses that name.

Third, there is no placement standard for it. Most often, you will find the file in a website's root directory (so that you could get it at at http://www.name.com/favicon.ico). Others, like Atlantis and famwagner.com, for instance, may place them within another directory. I consider them images, so I've placed them in an images/ directory.

So, what my hack does is look in all of those pages that are found in the referrer's list for a line of html code that declares that x site has a favicon and it can be found here. If it cannot find such a line, it builds a url assuming that a file called favicon.ico is in the website's root directory. So, having a url to a favicon.ico via either of these methods, it then tries to see if such a file exists. If the file exists, great, let's display it. If it doesn't exist, then we'll display nothing. Oh, and we'll also display nothing if anytime during this whole process, reading from that web server times out.

So, now you can see why it is time consuming. Try doing all of that stuff manually; it would take you some time. But, as I said, I'm trying to trim it down some and simplify it so that it seems almost seemless.

In the end, if I can't make it run more quickly, I may just disable it.

Have something to say about this entry? Submit your comment below.
name:
email:
web:
Give me a cookie and remember my personal info.
Hide my email address.
Type the correct answer: They are going to get they're / there / their reward.

This is a simple question designed to prevent spambots from spamming the site.

your comment(s):
[ Emoticons ]
Small print: All html tags except <b> and <i> will be removed from your comment. You can make links by just typing the url or mail-address.