OOP Web

In virtually every web application - performance should take precedence over everything.

PHP (and many other languages) are interpretive. The code is read over and over.

  • Organize the files such that the most commonly used code is first.
  • Keep files small.
  • Use a good architecture.
  • Don’t read data or access information that won’t be used. If it won’t go to the client, on every request, don’t read it.
  • Validate on the client side first, and don’t send the data to the server if it isn’t valid.
  • Perform quick validation and escaping to protect the server on the server side.
  • Cache files on the client whenever possible.
  • Cache information on the server, use session variables for anything that will be used on every request. Consider storing ACL data in a session variable, but be aware of security risks.
  • Be aware of PHP best practices, and the impacts of double-quoted strings.