Skip to content

Commit 38320a4

Browse files
authored
Updates
1 parent 2dea44f commit 38320a4

5 files changed

Lines changed: 52 additions & 14 deletions

File tree

CHANGELOG.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,27 @@ All notable changes to EngineScript will be documented in this file.
44

55
Changes are organized by date, with the most recent changes listed first.
66

7+
## 2025-10-21
8+
9+
### 🔄 CACHE MANAGEMENT IMPROVEMENTS
10+
11+
- **Enhanced FastCGI Cache Clearing**: Improved `clear_nginx_cache()` function with proper worker signaling
12+
- **Reliable Deletion**: Uses find command to delete cached files while preserving directory structure
13+
- **Worker Notification**: Added nginx reload signal to notify worker processes of cache changes
14+
- **Robust Error Handling**: Enhanced validation and directory existence checking
15+
- **Cookie Map Expansion**: Added 11 missing cookies to `map-cache.conf` for comprehensive cache bypass coverage:
16+
- **Authentication**: `amazon_Login_`, `duo_wordpress_auth_cookie`, `duo_secure_wordpress_auth_cookie`
17+
- **Session Management**: `S+ESS`, `SimpleSAML`, `PHPSESSID`, `bookly`, `fbs`
18+
- **Community Features**: `bp_completed_create_steps`, `bp_new_group_id`
19+
- **Map Organization**: Alphabetized entire cookie map for improved maintainability and duplicate prevention
20+
- **Pattern Coverage**: Total of 40+ cookie patterns now cover authentication, sessions, shopping carts, memberships, and plugin-specific cookies
21+
22+
### 🐛 BUILD SYSTEM IMPROVEMENTS
23+
24+
- **Patch Format Compliance**: Fixed nginx patches to comply with POSIX standards
25+
- **Trailing Newline**: Ensured all patch files end with proper newline character
26+
- **Warning Resolution**: Eliminated "patch unexpectedly ends in middle of line" warnings during compilation
27+
728
## 2025-10-14
829

930
### 🔧 UPDATE SYSTEM IMPROVEMENTS

config/etc/nginx/globals/map-cache.conf

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,29 @@ map $http_cookie $es_http_cookie {
1717
default 0;
1818

1919
# Do Not Cache: General
20+
"~*amazon_Login_" 1;
2021
"~*auth_" 1;
2122
"~*bookly" 1;
2223
"~*bp-" 1;
24+
"~*bp_completed_create_steps" 1;
25+
"~*bp_new_group_id" 1;
2326
"~*comment_" 1;
2427
"~*dshack_level" 1;
25-
"~*ecwid" 1;
28+
"~*duo_secure_wordpress_auth_cookie" 1;
29+
"~*duo_wordpress_auth_cookie" 1;
2630
"~*ec_" 1;
31+
"~*ecwid" 1;
2732
"~*edd_" 1;
33+
"~*fbs" 1;
2834
"~*jetpack" 1;
2935
"~*mp_globalcart" 1;
3036
"~*mp_session" 1;
3137
"~*no_cache" 1;
3238
"~*nocache" 1;
3339
"~*noaffiliate_" 1;
40+
"~*PHPSESSID" 1;
41+
"~*S\+ESS" 1;
42+
"~*SimpleSAML" 1;
3443
"~*store_notice" 1;
3544
"~*upsell_customer" 1;
3645
"~*wishlist_reg" 1;
@@ -41,8 +50,8 @@ map $http_cookie $es_http_cookie {
4150
"~*wordpress_" 1;
4251
"~*wordpresspass_" 1;
4352
"~*wordpressuser_" 1;
44-
"~*wp_woocommerce_session_" 1;
4553
"~*wp-" 1;
54+
"~*wp_woocommerce_session_" 1;
4655
"~*wpsc_" 1;
4756
"~*xf_" 1;
4857
"~*yith_w" 1;

scripts/functions/shared/enginescript-common.sh

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,25 @@ function print_last_errors() {
5959
# ----------------------------------------------------------------
6060
# Clear Nginx cache directory
6161
function clear_nginx_cache() {
62-
echo "Clearing Nginx Cache"
63-
rm -rf /var/cache/nginx/* || {
64-
echo "Error: Failed to clear Nginx cache."
65-
}
62+
echo "Clearing Nginx FastCGI Cache"
63+
64+
if [ -d "/var/cache/nginx" ]; then
65+
# Delete cache files while preserving directory structure
66+
find /var/cache/nginx -type f -delete 2>/dev/null || {
67+
echo "Error: Failed to clear Nginx cache."
68+
return 1
69+
}
70+
71+
# Signal Nginx to reload cache state
72+
if command -v nginx >/dev/null 2>&1; then
73+
nginx -s reload 2>/dev/null || true
74+
fi
75+
76+
echo "Nginx cache cleared successfully"
77+
else
78+
echo "Warning: Nginx cache directory not found at /var/cache/nginx"
79+
return 1
80+
fi
6681
}
6782

6883

scripts/install/nginx/nginx-create-directories.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ DIRS=(
3636
"/var/lib/nginx/fastcgi"
3737
"/var/lib/nginx/proxy"
3838
"/var/log/domains"
39+
"/var/log/nginx"
3940
"/var/www/admin/enginescript"
4041
"/var/www/sites"
4142
)

scripts/install/nginx/nginx-misc.sh

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,6 @@ if ! id "www-data" &>/dev/null; then
2727
useradd -r -s /bin/false www-data
2828
fi
2929

30-
# Ensure all necessary directories exist
31-
mkdir -p /var/log/nginx
32-
mkdir -p /var/log/domains
33-
mkdir -p /var/cache/nginx
34-
mkdir -p /var/lib/nginx/{body,fastcgi,proxy}
35-
mkdir -p /tmp/nginx_proxy
36-
mkdir -p /usr/lib/nginx/modules
37-
3830
# Assign Permissions BEFORE nginx tries to start
3931
set_nginx_permissions
4032

0 commit comments

Comments
 (0)