Web hosting
Publié le 30 Août 2016 à 05h59 - 2281 vues

Let's check your PHP script with us

Once your application works perfectly, you can try to optimize the execution time or memory consumption. However, take care not to go overboard. Before optimizing your php code you need to keep in mind 2 things:
- What takes the most time is not the PHP code but network access (BDD queries, web scraping) or disk (includes);
- An opcode cache tool can be charged optimize your PHP code for you (to some extent).

Some tips to reduce network access

- Minimize the number of requests you made to the relational database management system. This means avoiding queries in loops or unnecessary requests;
- Request only the bare minimum to the RDBMS when making a request. If you need a single column, SELECT * is avoided. When you want to count the number of lines, using COUNT (*);
- Avoid waste of memory using the least possible variables. Or do not create variables that contain the same as another.

Caching

Caching allows you not to execute new code that has already been executed recently.Take the example of a news site in which the home page has the latest news. Each visitor to the home page requires PHP to send an SQL query through the network, waiting for the response of the DBMS, retrieve data from the open socket for the occasion, treat and display. Knowing that the visits rate is very much higher than the frequency of updating the news, the vast majority of requests are redundant. These daily visits require PHP to unnecessarily perform summarized above treatments ... A caching solution could be to generate the complete HTML of the home page with each update of the database. Thus, no unnecessary query is sent to the DBMS. However, this technique is not reasonable for the entire site because of potential excessive amount of content to compile in advance. It is therefore necessary to resort to more subtle techniques, and it is here that the caching tools become interesting.

Let us have a look on the php code of your website and see what could be optimized with our php developers.

Les publications similaires de "Consulting"

  1. 29 Mars 2021London is the european start up capital !331 vues
  2. 17 Fév. 2021How to hire a php symfony developer ?879 vues
  3. 18 Janv. 2021Embracing a infrastructure in a fast lane1143 vues
  4. 12 Déc. 2020The skills to look for in a Php programmer1490 vues
  5. 5 Déc. 2020Integrated Development Environment framework1464 vues
  6. 6 Nov. 2020Php web development brought to you by SimplyPhp1115 vues
  7. 8 Oct. 2020All the new perks in Php Programming1044 vues
  8. 7 Sept. 2020SimplyPhp.com : Custom Php application development1187 vues
  9. 8 Août 2020SimplyPhp offeres you the best in terms of custom Php development1083 vues
  10. 10 Juil. 2020An active Php developer to hire1379 vues
  11. 8 Juin 2020A stand out team of Php developers available1564 vues
  12. 16 Mai 2020A thriving Php development company1689 vues
  13. 8 Avril 2020How to install a new script with php1975 vues