Drupal is slow. All of us know. But as they say humans have a tendency to aim for better and when we are better, aim for excellence. So out of human tendency while searching for improving the scope of performance, I came across few points which needs to be taken care of while developing a new Drupal site.
Ten commandments
-
Enable caching and aggregation for css and js. Include css in head and js in bottom of template file.
-
Never write heavy code in tpl files. Template files are only for rendering html, not for heavy DB queries and complex php code.
-
Don’t use php filter in custom block. Use hook_block () for custom blocks.
-
Minimize HTTP Requests. This has great impact on performance. Use image sprite OR data-uri’s for images.
-
Some useful module are performance killer like admin_menu, devel, context_ui, views_ui. So uninstall them on production site.
-
Use long expire header in htaccess. eg.
-
Some of these tools could be useful. Varnish, APC, mysql-tunner.
-
Maria db is way faster than mysql. Drupal.org is using this.
-
And If you have extra money, you can use CDN (Content Delivery Network).
-
If you are dealing with huge drupal site, you must take a look at this video