| @@ -27,23 +27,8 @@ | ||
| 27 | 27 | // add_action( 'wp_update_nav_menu', [ $this, 'purge_home_cache' ], 10, 2 ); |
| 28 | 28 | } |
| 29 | 29 | |
| 30 | 30 | /** |
| 31 | - * FastCGI cache purge url. | |
| 32 | - * | |
| 33 | - * @return string | |
| 34 | - */ | |
| 35 | - public function purge_cache_url() { | |
| 36 | - return wp_nonce_url( | |
| 37 | - add_query_arg( | |
| 38 | - [ 'flywp-action' => 'purge-fastcgi-cache' ], | |
| 39 | - admin_url( 'index.php?page=flywp' ) | |
| 40 | - ), | |
| 41 | - 'fly-fastcgi-purge-cache' | |
| 42 | - ); | |
| 43 | - } | |
| 44 | - | |
| 45 | - /** | |
| 46 | 31 | * Check if the cache is enabled. |
| 47 | 32 | * |
| 48 | 33 | * @return bool |
| 49 | 34 | */ |
| @@ -119,13 +104,8 @@ | ||
| 119 | 104 | */ |
| 120 | 105 | public function purge_cache_by_url( $url ) { |
| 121 | 106 | $parsed = wp_parse_url( $url ); |
| 122 | 107 | $path = isset( $parsed['path'] ) ? $parsed['path'] : ''; |
| 123 | - | |
| 124 | - // Ensure path ends with trailing slash | |
| 125 | - if ( substr( $path, -1 ) !== '/' ) { | |
| 126 | - $path .= '/'; | |
| 127 | - } | |
| 128 | 108 | |
| 129 | 109 | // cache key format (without space): $protocal $method $host $path |
| 130 | 110 | // because of nginx-proxy, all request will be http, so we don't need to check protocal |
| 131 | 111 | // $method is always GET as we only cache GET request |