| @@ -120,8 +120,13 @@ | ||
| 120 | 120 | public function purge_cache_by_url( $url ) { |
| 121 | 121 | $parsed = wp_parse_url( $url ); |
| 122 | 122 | $path = isset( $parsed['path'] ) ? $parsed['path'] : ''; |
| 123 | 123 | |
| 124 | + // Ensure path ends with trailing slash | |
| 125 | + if ( substr( $path, -1 ) !== '/' ) { | |
| 126 | + $path .= '/'; | |
| 127 | + } | |
| 128 | + | |
| 124 | 129 | // cache key format (without space): $protocal $method $host $path |
| 125 | 130 | // because of nginx-proxy, all request will be http, so we don't need to check protocal |
| 126 | 131 | // $method is always GET as we only cache GET request |
| 127 | 132 | $hash = md5( 'httpGET' . $parsed['host'] . $path ); |