PDA

View Full Version : Speeding up load time.


offthedome
04-05-2007, 22:53/10:53PM
I'd like to make my pages load faster. The best idea I've got is getting the shell of the page to be contained in a separate file.

I don't know how to do this, and I can't find a good tutorial. I'd appreciate help being pointed to one.

The site is ourspacer.com

Blue
05-05-2007, 05:16/05:16AM
Search Google for these terms:

"tableless design"

"CSS" - (Cascading Style Sheets)

The objective is to "seperate content from layout."

Utilizing a tabless design and CSS you should be able to bring the file size of your pages down to a bare minimum.

You should also research how to optimize graphic images so that they are small in file size without losing clarity.

offthedome
05-05-2007, 12:18/12:18PM
I actually do use css, and very few small tables if any, only in the body.

I'm looking for a way to have the user download the things that repeat on every page only the first time they visit. This is just the header and right and left columns.

Connie
05-05-2007, 12:36/12:36PM
Your home page load time is fine, and I'm on dial up.

Would suggest you do some work on the header. It's very Spammy looking. You have several meta tags that I don't think are of any value.


The title, description, and keywords for each page should be unique. Target no more than 3 keyword phrases per page.

offthedome
05-05-2007, 12:48/12:48PM
Originally posted by Connie
Your home page load time is fine, and I'm on dial up.

Would suggest you do some work on the header. It's very Spammy looking. You have several meta tags that I don't think are of any value.


The title, description, and keywords for each page should be unique. Target no more than 3 keyword phrases per page.
This one might be slow for you (Very large javascript file):

http://www.ourspacer.com/graphics/

The best idea I have to fix this is create separate pages for each set of 10 images. I can do that EASILY if I knew how to load header and columns separately.

I'll see what I can do about reducing keywords.

Blue
05-05-2007, 13:34/01:34PM
Originally posted by offthedome
I actually do use css, and very few small tables if any, only in the body.

I'm looking for a way to have the user download the things that repeat on every page only the first time they visit. This is just the header and right and left columns. OK.

Then what you'll want to do is use "PHP includes." Google that phrase and you should find some tutorials.

offthedome
05-05-2007, 18:08/06:08PM
I've been googling variants of "php include" and cache/caching in order to find a way to get a php include downloaded once and never having to do it again. It's hard because, apparently, there's a much more common phrase called php caching, which is not the same as the caching of a webpage that occurs when you visit it.

Do you know how to get a visitor's computer to REALLY cache a php include?

g1smd
05-05-2007, 18:16/06:16PM
With PHP includes the webserver assembles the HTML page from code fragments before it sends it out to the browser. This reduces the amount of page editing required when common content needs to be changed on a site.


What you are asking for, is something else. You are looking for a way for the computer to assemble the page from fragments. One way to do that, is by using frames, but that is building a site that will be a nightmare for search engines to spider.

Another way is by using javascript to "write" the HTML code to the browser window. Not only is that search engine unfriendly, it will mean the site fails to load at all in many browsers.

What you think you want to do, is not what you should be doing.

offthedome
05-05-2007, 18:27/06:27PM
Originally posted by g1smd
With PHP includes the webserver assembles the HTML page from code fragments before it sends it out to the browser. This reduces the amount of page editing required when common content needs to be changed on a site.


What you are asking for, is something else. You are looking for a way for the computer to assemble the page from fragments. One way to do that, is by using frames, but that is building a site that will be a nightmare for search engines to spider.

Another way is by using javascript to "write" the HTML code to the browser window. Not only is that search engine unfriendly, it will mean the site fails to load at all in many browsers.

What you think you want to do, is not what you should be doing.

When you say "many browsers" have javascript disabled, how many is "many"? I hear people say this *very often* but the truth is I don't know that many people who have disabled javascript, and that includes a bunch of computer science people.

Connie
05-05-2007, 18:40/06:40PM
I don't know anything about php includes, but I don't know why they would be different from an SSI include, which I use on my site. However, the browser does not cache a SSI include. Not sure why it would with a php include.

Even if you find a way to do this, you still need a unique title, description, and key words for each page. You can't just have a bunch of key words, that display the same on every page, like you do now.

Clean your meta tags up so they are both visitor friendly and SE friendly. You header is not your problem in regard to load time.

Yes even this page http://www.ourspacer.com/graphics/ though it loads a little slower would be acceptable, because the reader (visitor has some text to read while the page is loading.

I suspect on the above page your load time problem is all the external pages you are drawing information from.

For instance, you are displaying AdWords. The page will not fully load until your page fetches the actual adds from Google that they want to display on the page. That can slowdown load time.

Not sure what is going on with MySpace but I suspect something similar to Google. I suspect you are getting information from MySpace, and that will slow down page load time.

You might try putting those large javascript files, in a external file. A browser will cache the external javascript file just like it will an external CSS file.

g1smd
05-05-2007, 18:56/06:56PM
PHP includes work the same way as SSI includes do.

The webserver assembles the page before sending it.

Connie
05-05-2007, 19:57/07:57PM
Originally posted by g1smd
PHP includes work the same way as SSI includes do.

The webserver assembles the page before sending it.
That's what I thougt.

Dave Hawley
06-05-2007, 01:29/01:29AM
When you say "many browsers" have javascript disabled, how many is "many"? I hear people say this *very often* but the truth is I don't know that many people who have disabled javascript, and that includes a bunch of computer science people.Put it this way, javascript is on by default AFAIK, so those that do change it are likely very low in %. My webstats confirm this, where-as a SEO or web design type site etc may see a higher %.

In your case I'm guessing the only issues you have (other than what I mentioned before) is the heavy use of multiple graphics on single pages. I would simply have links to pages with 1 graphic per page that users can CHOOSE to load if they want.

Blue
06-05-2007, 13:08/01:08PM
Another approach you could try is to have only thumbnails of your graphics show on the page. Make them clickable to the full graphic, opening in a popup window or some alternative.

offthedome
06-05-2007, 13:33/01:33PM
Originally posted by Blue
Another approach you could try is to have only thumbnails of your graphics show on the page. Make them clickable to the full graphic, opening in a popup window or some alternative.

I'll do this for the layouts page I'm creating.

I'm working on this php include business. It's not working for me at all, and I KNOW 1and1.com supports php.

Funny .... the file I set it to include simply says "This is a test to see how easily includes can be placed on a website."

http://www.addressmunger.com/test3/testinclude.html
http://www.addressmunger.com/test3/testinclude.php

:mad: :mad: :mad:

Blue
06-05-2007, 13:48/01:48PM
The file you are including PHP includes into must have a .php extension.

offthedome
06-05-2007, 14:21/02:21PM
Originally posted by Blue
The file you are including PHP includes into must have a .php extension.
Wow ... I love how all the tutorials I found never actually said that.

:o: I hate being a n00b :confused:

Thanks for the pointer. That should help .....

Connie
06-05-2007, 17:51/05:51PM
You can use SSI (includes) to do the same thing for html pages, though it will require you add this to your .htaccess file. AddHandler server-parsed .htm .html. By default an apache server will only parse .shtml pages.

It doesn't make any difference whether you use a php include, or SSI. A browser is not going to cache either. The include puts the actual content on the page.

In contrast, you link to an external style sheet, or javascript. the browsers caches the external scripts, and doesn't need to reload them for each new page the surfer goes to.

Blue
06-05-2007, 18:12/06:12PM
Originally posted by Connie
It doesn't make any difference whether you use a php include, or SSI. A browser is not going to cache either. The include puts the actual content on the page.

In contrast, you link to an external style sheet, or javascript. the browsers caches the external scripts, and doesn't need to reload them for each new page the surfer goes to. I don't think that's correct Connie.

The webserver assembles the page as a whole, including includes. The browser then takes the output from the webserver and renders it, caching the elements it can from the page as a whole.

That's the whole idea behind utilizing includes. Since the browser has already cached those elements from the pre-assembeled page as a whole, it does not need to fetch them again, therefore saving bandwidth, processing power, and load time.

g1smd
06-05-2007, 19:38/07:38PM
>> The webserver assembles the page as a whole, including includes. The browser then takes the output from the webserver and renders it, caching the elements it can from the page as a whole. <<

That is nearly right. External CSS and JS files are cached separately, but the page of HTML code is cached as one complete page. It was the server that assembled all the HTML code fragments into one page, and it is that one page of HTML was sent to the browser.



>> That's the whole idea behind utilizing includes. Since the browser has already cached those elements from the pre-assembeled page as a whole, it does not need to fetch them again, therefore saving bandwidth, processing power, and load time. <<

No. For the next HTML page from the site that the visitor wants to look at, the browser will need to fetch all of the HTML for that page. It will not have separately been able to cache, say, the HTML for the navigation bar, or for the footer. The webserver already assembled everything into one. The browser would have separately cached the CSS and JS files though, and those will not need to be fetched again.

Connie
06-05-2007, 20:05/08:05PM
Seems Blue and G1 are saying the same thing. That contradicts everything I read about SSI when I first started researching it.

To help this dumb ol country boy. Every page on my site is made up of at least 5 SSI includes. From what I'm understanding that means the pages load faster because of the includes.

Everything I have ever read about includes say they will slow down page load time, because the server has to take additional action to parse the includes.

Some pages have an additional 4 includes. I have started using includes to include products on the page.

I decided against some changes to day that would require on the average 4 more includes per page.

If I'm understanding this correctly, if 6 includes are consistent on each page, then they will be cached and additional includes will not hurt page load time.

Then if part of the new includes are consistent on pages they will be cached too?

Connie
06-05-2007, 20:19/08:19PM
G1 got another post in before me.
No. For the next HTML page from the site that the visitor wants to look at, the browser will need to fetch all of the HTML for that page. It will not have separately been able to cache, say, the HTML for the navigation bar, or for the footer.
That I agree with. Basically that is what I have been trying to say, even though I did a poor job of explaining.

ihelpyou
06-05-2007, 20:25/08:25PM
yeah, blue and g1 were saying the same thing. lol

You are right as well Connie.

Everyone is right. Let's party! :D

Connie
06-05-2007, 23:08/11:08PM
Originally posted by ihelpyou
yeah, blue and g1 were saying the same thing. lol

You are right as well Connie.

Everyone is right. Let's party! :D

Not sure G1 was saying the same thing as Blue after his follow up post.

We can't all be right on this issue. Either an include is cached or it is not cached.

I'm not trying to be argumentive. I use a lot of SSI (Includes) on every page of my site.

My understanding is those includes slow down the load time of the page. The server has to do more work to display the page.

I don't think that is significant because it would be measured in mili seconds for most sites.

The original poster is looking for ways to include the same information in the head section and catch it to speed up page load time. I just don't think a php or SSI include will do that.

I'm always ready to party. In fact I started hours ago. :cheers: :cheers :cheers: :cheers:

Dave Hawley
06-05-2007, 23:28/11:28PM
I would just buy a vBulletin forum and use that :p

BTW Doug, do you know that vBulletin are up to 3.6.* now :D

offthedome
06-05-2007, 23:56/11:56PM
Hopefully I got this right:

1. I can improve download time if I use php includes, though they are not cached onto the hard drive.

2. It is NOT possible to use php includes in a file with a .html extension.

3. Other than using javascript, there's no way to get headers and columns cached only once.

4. We're all having a party. :cheers: First round's on me.

offthedome
07-05-2007, 00:00/12:00AM
Originally posted by offthedome
Hopefully I got this right:

1. I can improve download time if I use php includes, though they are not cached onto the hard drive.

2. It is NOT possible to use php includes in a file with a .html extension.

3. Other than using javascript, there's no way to get headers and columns cached only once.

4. We're all having a party. :cheers: First round's on me.

OK I have to add to this now.

I'm going to be changing everything from index.html to index.php for editing purposes anyway. I hate having to go through and edit every column !!!

The best way to get a person to go to the index.php page is:

1. Meta tag redirect?
2. Please, please please say there's something better!!

Blue
07-05-2007, 00:14/12:14AM
Originally posted by Connie
Not sure G1 was saying the same thing as Blue after his follow up post. You are correct on this point Connie. How I qualified my post on this topic was with this browser specific statement fragment: "caching the elements it can from the page as a whole."

Where it will save the most load time/bandwidth IMO is the caching of graphical elements used in includes. Once they've loaded the first time, and depending upon the users browser settings (which I believe most default to the default), they will not have to fetch them from the server again.

Though it has been, by choice, many years since I've had to think about these issues, I believe that both G1's and my statements stand true.

*****

I believe the SSI include issue you may have been thinking about Connie is the "security" factor involved with .shtml extensions, in that these inherently return, to fetch all elements that make up a page, to the server.

The issue was that SSI, usually being parsed as .shtml, was more server intensive.

With your "add-handler .htaccess parse .shtml as .html" workaround Connie, I don't know if that is an issue or not. G1?

Blue
07-05-2007, 00:33/12:33AM
Originally posted by offthedome
The best way to get a person to go to the index.php page is:

1. Meta tag redirect?
2. Please, please please say there's something better!! If your server is set up correctly (and it is a *nix box, I don't know about Windows), it should serve up your "index.php" page as the "default home page" as long as it doesn't find an "index.html" or "index.htm" page in that folder.

*nix boxes have a file that they look to which tells them what file names (before the .ext(ension)) and in which order it is to look for and then serve up as the default "home page."

You can, if memory serves, change (or add file names to) which file names these are, and their order, through .htaccess (or if you are running your own server, such as a dedicated, and not shared, server, you can edit the particular file itself, though I don't recall what file that is right now).

Blue
07-05-2007, 00:34/12:34AM
Now it's time for me to join the party!!! :D :cheers:

Dave Hawley
07-05-2007, 00:46/12:46AM
The best way to get a person to go to the index.php page is:Yep, I use a .htaccess to 301 my index.php to /

Danny
07-05-2007, 05:50/05:50AM
It is my understanding that the 'last modified date' is not sent on SSI pages by default. This may prevent caching from the pages which means that if a visitor visits page1, then page 2 and finally page 1 again, then the entire page (except images and external files such as JS and/or CSS) will have to be send 3 times
whereas if it were a normal html page, page1 would be cached on the user's pc and grabbed from there.
This would mean that (in it's default configuration) SSI has 2 disadvantages with regard to load time :
1. Pages need to be parsed for ssi includes
2. Pages are not cached

Pls correct me if i'm wrong

offthedome
10-05-2007, 23:54/11:54PM
1. Is it good, bad, or neither for SEO if I have a separate page for every 10 images on my page?

I'm asking because I don't know how to create a way to scroll through all the images without putting the image list in a javascript array and downloading the entire array first.

2. Seriously... I should have learned php before the bits of perl I know. It just seems to be better.

Can anyone recommend a good free online tutorial or cheap book? My goals are website building techniques, but I need to know the basics too, like how to make an array.

Dave Hawley
11-05-2007, 00:45/12:45AM
You should stop catering to SEs and think of your visitors 1st and foremost.

1) Supply links to pages with single images.
OR
2) Thumbnail them.

g1smd
11-05-2007, 20:27/08:27PM
>> Hopefully I got this right: <<

>> 1. I can improve download time if I use PHP includes, though they are not cached onto the hard drive. <<

A page with PHP includes, assembled by the server, will take the same time to download as the same page delivered as a static single page of code. By the time it is delivered to the browser it IS a single page of code.


>> 2. It is NOT possible to use PHP includes in a file with a .html extension. <<

You can have any extension that you like. You just to make sure that the extension is defined in the Server Configuration files.


>> 3. Other than using Javascript, there's no way to get headers and columns cached only once. <<

That is right. You can only cache the header and footer separately if that information is delivered separately to the browser as separate files: using either Javascript or frames. Both of those methods are NOT search-engine friendly and should be avoided at all costs.