3

I am currently working on my first small comercial projects in web development.

Performance is always crucial, so I would like to know what steps should I follow before putting my website on the server to make sure the performance is just the best it can be.

  • I have heard there are some tools which rename all variables in a project to one letter variables and also delete new line characters, so that only the minimum of data is sent via the Internet and that improves performance

  • I like to create smaller files as some modules and then put them in index.php like this:

    <html>
      <head>
        <?php include index_head.php ?> // here
      </head>
      <body>
        <nav>
        <?php include index_nav.html ?> // and here
        </nav>
      // and so on...
    

    what that gives is of course you write the code once and then link it where you want... Does such use of include change performance?

  • Any other suggestions?
Maciej Dobosz
  • 148
  • 1
  • 12
  • 1
    If you want to have improve performances, look into caching your data to avoid fetching the database when you can avoid it and think about using a cdn for media content too – olibiaz Jul 06 '17 at 14:37
  • For your question about includes: https://stackoverflow.com/questions/10774672/does-including-too-many-files-in-php-reduce-performance – M0CH1R0N Jul 06 '17 at 14:44
  • Good link @M0CH1R0N, thanks – Maciej Dobosz Jul 06 '17 at 15:25

2 Answers2

3

I have heard there are some tools which rename all variables in a project to one letter variables and also delete new line characters, so that only the minimum of data is sent via the Internet and that improves performance

That's called "minifying" (making minimum) and can yield significant performance gains. We do that where I work as an automated build step. Definitely take that step. There are numerous tools available for you to use. Google "minify" or "minifier."

TomServo
  • 7,248
  • 5
  • 30
  • 47
0

Well developers take different steps to increase Performance of the website. You can find Ideal solutions for it but not a perfect one. Here is the list of some Ideal steps for boosting Up your Website Performance.

  • Minimize HTTP Requests.
  • Reduce server response time.
  • Enable compression.
  • Enable browser caching.
  • Minify Resources.
  • Optimize images.
  • Optimize CSS Delivery.
  • Prioritize above-the-fold content
  • Reduce the number of plugins you use on your site
  • Reduce redirects

For coding the best thing is create separate files and include them in your index file. Deployment is also the main part you need to see if your hosting is fast and robust enough to make your website up every time.

Shahroze Nawaz
  • 589
  • 5
  • 9