Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Page 1 of 2 1 2 LastLast
Results 1 to 10 of 14
  1. #1
    Senior Member Blackhawk095's Avatar
    Join Date
    May 2011
    Location
    Kentucky (USA)
    Posts
    384
    Member #
    27969
    Liked
    45 times
    I recently finished a fairly large website project that I've been working on. But I have realized how time consuming it is to update it.

    Because of this, I have decided to use the php "include" function so I can update the CSS, navigation, and footer once, and update the whole website. I created a test page to see if it would work correctly. It did, but the page took 3-4 seconds to load on a fast computer. Without using the PHP "include" function, the page usually takes about half a second to load on the same computer.

    Is there a way to use the "include" function and still keep the loading time fast?
    [COLOR=rgb(0, 51, 102)]Student Web Designer[/COLOR]
    [COLOR=rgb(0, 51, 102)]If you thought something I said was helpful. LIKE IT![/COLOR]

  2.  

  3. #2
    Senior Member Webzarus's Avatar
    Join Date
    May 2011
    Location
    South Carolina Coast
    Posts
    3,322
    Member #
    27709
    Liked
    770 times
    It could be your hosting provider ??? just a thought.

    In ASP we have a built in command called Server.execute as well as the the includes support.

    I found a long time ago, that building the repeatable parts of the page into functions and just calling the functions where needed was much more efficient than calling a whole bunch of include files ?

  4. #3
    Senior Member Harmonic's Avatar
    Join Date
    Jan 2011
    Location
    Toronto
    Posts
    291
    Member #
    26468
    Liked
    23 times
    Webzarus is right. Sounds like a slow server to me. I used includes all the time with no (visible) delays.

  5. #4
    WDF Staff George Dolidze's Avatar
    Join Date
    Apr 2011
    Location
    Irvine, CA
    Posts
    2,487
    Member #
    27540
    Liked
    416 times
    Same here. I've never had a problem with includes. It's basically copy & paste.
    My freelancer website: DolidzeDesign



    You only need a parachute if you plan on skydiving twice.

  6. #5
    Senior Member Blackhawk095's Avatar
    Join Date
    May 2011
    Location
    Kentucky (USA)
    Posts
    384
    Member #
    27969
    Liked
    45 times
    Right now, I'm using a free webhost (000webhost). BUT, the website will eventually be transferred to the school's server, which should be a lot faster. If what you guys are saying is true, I guess it will be fine. Thanks, but one quick question.

    To improve my PHP skills, I have decided to create a giant CMS on the website. The website has login's, so I'll create admin profiles where they will be able to edit the website content themselves. They would be able to edit: news feeds, photo gallery, and other specific sections of the website.

    I plan on doing this by storing all of the content in a database. I can't use the schools databases so I have to use the one on 000webhost. (I'm using a free account)

    Will this slow down the loading time in general, or would it depend on the hosting site?

    If using a free account will slow it down, would a paying account be the better choice?
    [COLOR=rgb(0, 51, 102)]Student Web Designer[/COLOR]
    [COLOR=rgb(0, 51, 102)]If you thought something I said was helpful. LIKE IT![/COLOR]

  7. #6
    WDF Staff George Dolidze's Avatar
    Join Date
    Apr 2011
    Location
    Irvine, CA
    Posts
    2,487
    Member #
    27540
    Liked
    416 times
    I don't think includes should be a problem on 000webhost. They have worked perfectly for me. Maybe try to see if something else is causing the lag?
    My freelancer website: DolidzeDesign



    You only need a parachute if you plan on skydiving twice.

  8. #7
    Senior Member Blackhawk095's Avatar
    Join Date
    May 2011
    Location
    Kentucky (USA)
    Posts
    384
    Member #
    27969
    Liked
    45 times
    I guess I didn't explain clearly. The "PHP: Include" issue is over. I didn't know that the cause would be from a slow server. That issues will be fixed once I move the website over to the school's server.

    Now, I'm planning on setting up a CMS (I haven't started creating this yet). I would like to know if storing all of the editable content in a database would slow it down.

    I also want to know if it would be better to have a database on a free or paying 000webhost account.(which would be faster?)
    [COLOR=rgb(0, 51, 102)]Student Web Designer[/COLOR]
    [COLOR=rgb(0, 51, 102)]If you thought something I said was helpful. LIKE IT![/COLOR]

  9. #8
    Senior Member Harmonic's Avatar
    Join Date
    Jan 2011
    Location
    Toronto
    Posts
    291
    Member #
    26468
    Liked
    23 times
    Well... yes it WILL slow down the site. You now have to query a database to get your information.

    But If your web server is good, there will be no visible delay caused by the queries.

    The paid would likely be faster. Paid memberships are probably on a better server than 000webhost gives it's free members. I can't guarantee this though.

  10. #9
    WDF Staff mlseim's Avatar
    Join Date
    Apr 2004
    Location
    Cottage Grove, Minnesota
    Posts
    7,716
    Member #
    5580
    Liked
    718 times
    If you're old enough for a credit card, or your parents have a credit card,
    subscribe to a real webhost and create your own domain name. You can get
    a real webhost account for about $40 a year ... that's like $3 a month, or a
    burger and fries at McDonald's.

    Many lost cost hosts, like cleverdot.com, and others like them.

    You get the whole deal ... FTP, PHP, MySQL, lots of storage, you own domain name
    such as "blackhawk095.com" ... and you can do whatever you want.

    If you're a younger student (minor), having your parents pay with their credit card
    is probably the best educational money they'll spend this year. $40 to have their
    child learn scripting, programming, databases ... you can even create personal pages
    for your family ... even create a WordPress blog with a click of a button (using the
    built-in Fantastico, or auto-install features of the webhost).

    I don't know why anyone, even young students, constantly deal with the frustration of
    "free webhosts". They are not free ... as you discovered.

    .

  11. #10
    WDF Staff AlphaMare's Avatar
    Join Date
    Oct 2009
    Location
    Montreal, Canada
    Posts
    4,570
    Member #
    20277
    Liked
    878 times
    How many includes are you using? Remember that PHP code is processed server side prior to the response being sent back to the client - if there are a lot of them and the server is slow this could be causing the delay.
    Good design should never say "Look at me!"
    It should say "Look at this." ~ David Craib


    http://digitalinsite.ca ~ my current site . . info@digitalinsite.ca ~ my email

    If you feel that someone's post helped you fix your problem, answered your question, or just made you feel better, feel free to "Like" their post. The "Like" link is at the bottom right of each post, along side the "reply" link. And if you are being helped here, try to help someone else - pass it on!


Page 1 of 2 1 2 LastLast

Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Search tags for this page

include php load time

Click on a term to search for related topics.
All times are GMT -6. The time now is 10:16 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com