$::form->footer;
 
+  if ($self->_interface_is_fcgi) {
+    # fcgi? send send reponse on its way before cleanup.
+    $self->{request}->Flush;
+    $self->{request}->Finish;
+  }
+
+  $::lxdebug->end_request;
+
   # cleanup
   $::auth->save_session;
   $::auth->expire_sessions;
   $::form     = undef;
   $::myconfig = ();
   $::request  = undef;
-  Form::disconnect_standard_dbh;
 
-  $::lxdebug->end_request;
+  SL::DBConnect::Cache->reset_all;
+  Form::disconnect_standard_dbh;
 
   $self->_watch_for_changed_files;