Skip to content

Commit

Permalink
Define FS_METHOD in pantheon mu-plugin: this setting can result in a …
Browse files Browse the repository at this point in the history
…significant performance improvement for sites that have highly populated directories. This setting has been documented previously at https://pantheon.io/docs/plugins-known-issues#define-fs_method
  • Loading branch information
namespacebrian authored and Pantheon Automation committed Apr 27, 2022
1 parent faba03b commit 5d066c9
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion wp-content/mu-plugins/pantheon.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Plugin Name: Pantheon
* Plugin URI: https://pantheon.io/
* Description: Building on Pantheon's and WordPress's strengths, together.
* Version: 0.1
* Version: 0.2
* Author: Pantheon
* Author URI: https://pantheon.io/
*
Expand All @@ -19,4 +19,16 @@
if ( ! defined('RETURN_TO_PANTHEON_BUTTON') || RETURN_TO_PANTHEON_BUTTON ) {
require_once 'pantheon/pantheon-login-form-mods.php';
}
if ( ! defined( 'FS_METHOD' ) ) {
/**
* When this constant is not set, WordPress writes and then deletes a
* temporary file to determine if it has direct access to the filesystem,
* which we already know to be the case. This multiplies filesystem
* operations and can degrade performance of the filesystem as a whole in
* the case of large sites that do a lot of filesystem operations.
* Setting this constant to 'direct' tells WordPress to assume it has
* direct access and skip creating the extra temporary file.
*/
define( 'FS_METHOD', 'direct' );
}
} // Ensuring that this is on Pantheon.

0 comments on commit 5d066c9

Please sign in to comment.