There are a few other things that you can do to make your web server run more efficiently.
Apache is the most common web server used with Drupal, and it can be tweaked to provide better performance. The following sections will suggest some approaches to try.
# Requires mod_expires to be enabled. <IfModule mod_expires.c>
# Enable expirations. ExpiresActive On
# Cache all files for 2 weeks after access (A). ExpiresDefault A1209600
# Do not cache dynamically generated pages. ExpiresByType text/html A1
We can't let mod_expires cache HTML content, because the HTML content Drupal outputs is not always static. This is the reason Drupal has its own internal caching system for its HTML output (i.e., page caching).
Drupal ships with two .htaccess files: one is at the Drupal root, and the other is automatically generated after you create your directory to store uploaded files and visit Administer >■ File system to tell Drupal where the directory is. Any .htaccess files are searched for, read, and parsed on every request. In contrast, httpd.conf is only read when Apache is started. Apache directives can live in either file. If you have control of your own server, you should move the contents of the .htaccess files to the main Apache configuration file (httpd.conf) and disable .htaccess lookups within your web server root by setting AllowOverride to None:
<Directory /> AllowOverride None
This prevents Apache from traversing up the directory tree of every request looking for the .htaccess file to execute. Apache will then have to do less work for each request, giving it more time to serve more requests.
Another option is to use a web server other than Apache. Benchmarks have shown that, for example, the LightTPD web server generally serves more requests per second for Drupal. See http://buytaert.net/drupal-webserver-configurations-compared for more detailed comparisons.
Was this article helpful?