Performance
Performance
Drupal is a very powerful content management system which relies on storing content in a database for serving up to the web. Using a database to store content allows you to build flexible and powerful workflow systems to control many different people all authoring and validating content. Drupal accesses the database and saves the information in a storage area known as a 'cache' before serving the page up to the web. The cache can be turned off and on and you may need to employ various techniques if you have large numbers of users accessing your site or a complex Drupal implementation.
Caching
Drupal caching can be tuned on in the Performance section of the Configuration page very simply by clicking the Cache pages for anonymous users checkbox. You may want to disable caching when you are rapidly adding content as you may not see the most up to date content in certain circumstances. You can always Clear all caches if you need to be sure of viewing the latest content. You may also choose to Clear all caches before backing up or moving a database and the caches may store a considerable amount of data.
Note that caching does not take place for logged in users. Only anonymous users receive pages from cache as it is supposed that the users that log on to the system receive data in content types or blocks that may change from user to user. Blocks often vary depending on the context of the main content but these can also be cached in a similar manner to normal pages (except these are also cached for logged in users).
Drupal caching and CSS and JavaScript aggregation are neat one-click solutions to some of the performance problems that a sophisticated content management systems such as Drupal can create. Different content types and themes and fields all have varying requirements which may result in a large number of associated support files being required. The aggregation option is a quick solution that resolves this problem.
Caching only applies to non-authenticated usrrs. Once you log on the caching is disabled as much of the content may be specific to the user. Drupal performs a lot of database lookups and processing perticularly if you have a large number of modules installed and you may need to look to further performance optimisation options if you have a busy site.
Bandwidth Optimisation
A typical Drupal installation may have twenty or so JavaScript and stylesheet files defined in the theme. A web browser will have to retrieve all these files the first time a page from your website is shown and this process can be relatively slow compared with the effort required to downlaod a single compressed file containing all the separate code. Drupal allows you to build compressed JavaScript or CSS file of all the files mentioned by your Drupal theme to reduce the bandwidth cost of anyone browsing your website for the fist time.
Stylesheet designers can also take advantage of delivering some JavaScript through various CDN Content Delivery Networks which can also improve performance in certain circumstances.
Modules
Each module contains a number of 'hooks' which do some processing at different stages each time Drupal serves up a web page. These hooks process information whether or not the module is actually used and so modules that you are not using or that are required only during the development phase of the project (such as the color selection for a theme) should be disabled. There is a small performance hit even if the module remains installed so you might uninstall modules once you have no need for them on high performance sites. You can install from the modules administration page once you have disabled the module (and any dependent modules).
Other Options
Drupal does a lot of things each time a page is served and you may find the caching options provided are not enough. You might investigate the Boost module which caches pages by writing them to disc or perhaps use the services of a specialist Drupal hosting provider (such as GetPantheon) who can provide you with a variety of performance options.
If you are managing your own hardware, it is possible to add a speed-up cache for your PHP code (APC cache) onto your server or add the memcache system which will cache the results of your database queries in memory and speed up your website. Other options include installing the Varnish reverse proxy or running one or more servers with load balancing.