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:19:56 -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: index.php
===================================================================
RCS file: /cvs/drupal/drupal/index.php,v
retrieving revision 1.93
diff -u -F^f -r1.93 index.php
--- index.php	6 Apr 2007 13:27:20 -0000	1.93
+++ index.php	11 Jun 2007 02:19:56 -0000
@@ -9,6 +9,14 @@
  * prints the appropriate page.
  */
 
+// 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.
+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();
+}
+
 require_once './includes/bootstrap.inc';
 drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
 
