Index: .htaccess
===================================================================
RCS file: /cvs/drupal/drupal/.htaccess,v
retrieving revision 1.85
diff -u -F^f -r1.85 .htaccess
--- .htaccess	18 May 2007 22:09:45 -0000	1.85
+++ .htaccess	11 Jun 2007 02:52:25 -0000
@@ -7,6 +7,16 @@
   Order allow,deny
 </FilesMatch>
 
+# The following line prevents Drupal's 404 handler from kicking in and doing 
+# a full bootstrap when certain types of files are not found.
+# Uncomment the following to save server and bandwidth resources.
+# You must uncomment the corresponding the RewriteCond line later in this file
+#
+# #<FilesMatch "\.(png|gif|s?html|jpe?g|css|js|cgi|ico|swf|flv)$">
+# #  ErrorDocument 404 default
+# #</FilesMatch>
+#
+
 # Don't show directory listings for URLs which map to a directory.
 Options -Indexes
 
@@ -86,6 +96,13 @@
   # the rewrite rules are not working properly.
   #RewriteBase /drupal
 
+  # The following line prevents Drupal's 404 handler from kicking in and doing 
+  # a full bootstrap when certain types of files are not found.
+  # Uncomment the following to save server and bandwidth resources.
+  # You must uncomment the corresponding FilesMatch line earlier in this file
+  #
+  # RewriteCond %{REQUEST_URI} !\.(png|gif|s?html|jpe?g|css|js|cgi|ico|swf|flv)$
+
   # Rewrite URLs of the form 'index.php?q=x'.
   RewriteCond %{REQUEST_FILENAME} !-f
   RewriteCond %{REQUEST_FILENAME} !-d
Index: sites/default/default.settings.php
===================================================================
RCS file: /cvs/drupal/drupal/sites/default/default.settings.php,v
retrieving revision 1.1
diff -u -F^f -r1.1 default.settings.php
--- sites/default/default.settings.php	8 May 2007 16:36:55 -0000	1.1
+++ sites/default/default.settings.php	11 Jun 2007 02:52:26 -0000
@@ -137,6 +137,18 @@
 ini_set('url_rewriter.tags',        '');
 
 /**
+ * The following section prevents Drupal's 404 handler from kicking in and doing
+ * a full bootstrap when certain types of files are not found.
+ * Uncomment the following to save server and bandwidth resources.
+ * Please uncomment the corresponding lines in .htaccess too.
+ */
+
+//if (preg_match("/\.(png|gif|s?html|jpe?g|css|js|cgi|ico|swf|flv)$/", $_SERVER['QUERY_STRING'])) {
+//  header('HTTP/1.0 404 Not Found');
+//  exit();
+//}
+
+/**
  * Drupal automatically generates a unique session cookie name for each site
  * based on on its full domain name. If you have multiple domains pointing at
  * the same Drupal site, you can either redirect them all to a single
