Shorthand CSS Properties
The CSS can be made clean with removing the properties names as mentioned below. This can help in reducing the size of CSS in the process of development of website.
Font
Use:
font: 1em/1.5em bold italic serif
…instead of
font-size: 1em; line-height: 1.5em; font-weight: bold; font-style: italic; font-family: serif
PHP Code Optimization
I have found the post by Reinhold Webber, which provide good techniques and methods for PHP performance and optimization. I have tried to add more explanation to the points posted by Reinhold Webber.
- If a method can be static, declare it static. Speed improvement is by a factor of 4.
- echo is faster than print and print_r.
- Use echo’s multiple parameters instead of string concatenation.
- Set the maxvalue for your for-loops before and not in the loop.
- Unset your variables to free memory, especially large arrays.
- Avoid magic like __get, __set, __autoload.