mcomo
Senior Member
Don't Be Denied The Success You Deserve!
Posts: 790
|
Post by mcomo on Dec 8, 2007 8:06:45 GMT -5
I would like to add a file just before the /body tag on my web pages so that if I want to add something to all of my files at once it will be easy. In the beginning I will put my site counter there. Can anyone tell me how to do this. I looked up on the internet and saw how to do it using php such as .. <?php include 'counters.php'; ?> , but for some reason it adds a 1/4 of a second to my load time and I don't want that. I guess it is the time to access the file. I have a feeling there is a better way that I do not know about.
Thank You,
Mike C
|
|
|
Post by troyzone on Dec 9, 2007 10:18:09 GMT -5
Hi Mike, It is probably possible to do this using PHP (I don't really know PHP myself), but the method I've seen discussed here in the past that can be used to include other files in your web page to make up portions of it so that you can just edit a given file and have it affect many pages is SSI, or Server Side Includes. I haven't messed with SSI myself thus far, but there is a whole article on the topic right here in the forum's Website Creation Tool Kit FAQ board. It can be found here: Planning For Growth Using SSIerichw33.proboards53.com/index.cgi?board=tool&action=display&thread=1143746450Any time you have questions about how to do something webpage-related, it is a good idea to check those FAQs first as there may already be information there on how to do it. There may very well be other ways to accomplish what you want to do too, I'm not sure...my background is in operating systems/hardware/networking and not programming...but SSI is the only method that I'm somewhat familiar with thus far. I would think that any method used to include extra files in your web page would add to its load time though, as the server would still have to seek and provide the requested page(s) no matter what method you use. I don't think there is any way to avoid this, and it is one of the drawbacks of accessing multiple files to construct a page. A quarter of a second is not very significant however...if a web surfer can't wait a mere quarter of a second then they don't belong on the Internet I'd be much more concerned if it added several seconds to your load time, but a quarter of a second should not make any significant difference as far as your visitors waiting for the page to load goes, especially if the top area of the page appears first and the part being waited for is lower on the page out of sight, so they're able to read what you have up top even before the rest of the page finishes loading. Basically, extra files require extra hard disk seeking and access on the server, so I don't think it's physically possible at present to avoid that extra seek time until data storage technology improves even further. In any case, I just loaded your page quick and it didn't take very long, at least not on my DSL high-speed connection, so I don't think you have anything to worry about as far as load time goes. Hope this helps. Troy
|
|
mcomo
Senior Member
Don't Be Denied The Success You Deserve!
Posts: 790
|
Post by mcomo on Dec 9, 2007 10:26:05 GMT -5
Hi Mike, It is probably possible to do this using PHP (I don't really know PHP myself), but the method I've seen discussed here in the past that can be used to include other files in your web page to make up portions of it so that you can just edit a given file and have it affect many pages is SSI, or Server Side Includes. I haven't messed with SSI myself thus far, but there is a whole article on the topic right here in the forum's Website Creation Tool Kit FAQ board. It can be found here: Planning For Growth Using SSIerichw33.proboards53.com/index.cgi?board=tool&action=display&thread=1143746450Any time you have questions about how to do something webpage-related, it is a good idea to check those FAQs first as there may already be information there on how to do it. There may very well be other ways to accomplish what you want to do too, I'm not sure...my background is in operating systems/hardware/networking and not programming...but SSI is the only method that I'm somewhat familiar with thus far. I would think that any method used to include extra files in your web page would add to its load time though, as the server would still have to seek and provide the requested page(s) no matter what method you use. I don't think there is any way to avoid this, and it is one of the drawbacks of accessing multiple files to construct a page. A quarter of a second is not very significant however...if a web surfer can't wait a mere quarter of a second then they don't belong on the Internet I'd be more concerned if it added several seconds to your load time, but a quarter of a second should not make any significant difference as far as your visitors waiting for the page to load goes, especially if the top area of the page appears first and the part being waited for is lower on the page out of sight so they're able to read what you have up top even before the rest of the page finishes loading. I just loaded your page quick and it didn't take very long, at least not on my DSL high-speed connection, so I don't think you have anything to worry about as far as load time goes. Troy Thanks Troy, I went ahead with the php method as I too figured 1/4 of a second would not be too bad. I searched and could not find anything using the search box so thank you for the link. Mike C
|
|
|
Post by troyzone on Dec 9, 2007 10:34:48 GMT -5
You're welcome Mike. I was just revising my post above a bit when you replied so you might want to take another look... The forum search box is very handy for finding things on the forum, however it is often only good if you know exactly what you're looking for. In a case like this, you would probably be better off visiting the FAQ boards and manually browsing the topics there and investigating them if the search feature does not turn up what you are looking for.
I'm not sure if there are any pros or cons to using PHP over SSI or vice versa...it probably comes down to what your particular web server supports as much as anything, and most web hosts would support both of these technologies these days.
Troy
|
|
Ken
Senior Member
Posts: 420
|
Post by Ken on Dec 9, 2007 10:46:55 GMT -5
Hi Mike,
Since you are using php you can add these lines to your .htaccess fie to speed up your load time:
php_flag zlib.output_compression on php_value zlib.output_compression_level 9
|
|
mcomo
Senior Member
Don't Be Denied The Success You Deserve!
Posts: 790
|
Post by mcomo on Dec 9, 2007 16:29:37 GMT -5
Hi Mike, Since you are using php you can add these lines to your .htaccess fie to speed up your load time: php_flag zlib.output_compression on php_value zlib.output_compression_level 9 Hi Ken, I already have that incorporated from when you told me last year. Very helpful indeed. Thank you Mike C
|
|