Skip to content

Commit 4d91d32

Browse files
authored
Update ss-purge-opcache.txt
1 parent 6cc5b41 commit 4d91d32

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

bash/ss-purge-opcache.txt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,15 +65,18 @@ ss_echo "${COLOR_INFO}Running ss-purge-opcache... ${COLOR_RESET}"
6565
#### D. SS-Purge-OPcache: Purge OPcache Via WP-CLI #################################################
6666
####################################################################################################
6767

68-
## by default OPcache only caches PHP files for a few seconds but we clear it to be sure ##
69-
## this snippet will also clear physical OPcache files if the feature is enabled ##
68+
## clears in-memory OPcache using WP-CLI ensuring updated scripts load without any delay ##
69+
## does not remove physical OPcache files, only resets cached PHP files in memory ##
7070

7171
sudo -u "${SFTP_USER}" "${PATH_WP_CLI}" --path="${PATH_WEB_ROOT}" eval 'if (function_exists("opcache_reset")) { opcache_reset(); }'
7272

7373
####################################################################################################
7474
#### E. SS-Purge-OPcache: Purge OPcache Via PHP Script (Fallback) ##################################
7575
####################################################################################################
7676

77+
## creates and executes temporary PHP script to manually reset OPcache via curl request ##
78+
## always runs regardless of WP-CLI method, ensures OPcache is cleared properly ##
79+
7780
## generate unique filename ##
7881
RANDOM_STRING_PURGE_OPCACHE=$(openssl rand -hex 12)
7982
PURGE_OPCACHE_FILE="/var/www/html/purge-${RANDOM_STRING_PURGE_OPCACHE}.php"

0 commit comments

Comments
 (0)