From 0488c72cca11e875dfd947ae1c94d2ef76c4b925 Mon Sep 17 00:00:00 2001 From: donncha Date: Fri, 3 Feb 2017 15:10:24 +0000 Subject: [PATCH] Don't cache PUT and DELETE requests There are checks for PUT and DELETE request methods later in the plugin but it's better to short circuit it at the start. --- wp-cache-phase1.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wp-cache-phase1.php b/wp-cache-phase1.php index 9c15b604..8c6cc817 100644 --- a/wp-cache-phase1.php +++ b/wp-cache-phase1.php @@ -47,7 +47,7 @@ do_cacheaction( 'cache_init' ); -if ( ! $cache_enabled || $_SERVER["REQUEST_METHOD"] == 'POST' || isset( $_GET['customize_changeset_uuid'] ) ) { +if ( ! $cache_enabled || in_array( $_SERVER["REQUEST_METHOD"], array( 'POST', 'PUT', 'DELETE' ) ) || isset( $_GET['customize_changeset_uuid'] ) ) { return true; }