| 开发者 |
nasruleam
celsiusanderson |
|---|---|
| 更新时间 | 2026年9月15日 18:14 |
| PHP版本: | 8.1 及以上 |
| WordPress版本: | 7.1 |
| 版权: | GPL-2.0-or-later |
| 版权网址: | 版权信息 |
advanced-cache.php drop-in. On a cache HIT, the drop-in serves complete HTML
before the normal WordPress bootstrap and database queries. This early-response
path reduces application-layer work and keeps repeat page requests fast across
Nginx, Apache, and LiteSpeed.
The cache is designed to fail open when its storage layer is unavailable, so a
cache connection problem does not take the WordPress site offline.
Nginx has a default fastcgi_buffer_size of only 4KB–8KB. When combining rich caching headers with WooCommerce session cookies, the upstream response header exceeds this limit. Nginx immediately terminates the connection with:
upstream sent too big header while reading response header from upstream, resulting in an instant 502 Bad Gateway error.
To resolve this, add the following FastCGI and proxy buffer directives to your Nginx configuration (within the http {}, server {}, or PHP location block):
fastcgi_buffer_size 32k;
fastcgi_buffers 16 16k;
fastcgi_busy_buffers_size 32k;
proxy_buffer_size 32k;
proxy_buffers 16 16k;
proxy_busy_buffers_size 32k;
After adding these directives, test and reload Nginx:
nginx -t && systemctl reload nginx
Two common causes:
wp_woocommerce_session_* cookie.When LUMENCACHE_CACHE_SALT is set, PHP stores keys as SHA-256 hashes. A
server-level configuration must use the same key strategy or it will produce
cache misses. Disable the salt for a plain-key configuration, or use the
compatible hashed-key server template.
Yes. LiteSpeed supports Apache-compatible .htaccess rewrites. LumenCache uses
the Apache proxy mode on LiteSpeed. For better performance, ask your host
which in-memory cache acceleration options are available.
Yes — constants always take precedence over admin settings. If you define a constant, the corresponding field in the Settings tab is shown locked (read-only).
lumencache_is_pro_active() to verify defined( 'LUMENCACHE_PRO_VERSION' ) && get_option( 'lumencache_pro_status' ) === 'active', preventing false positive status if the Pro add-on is deactivated or uninstalled.lumencache_purge_urls into single-URL purge operations (purge_url), ensuring Admin Bar "Purge This URL" and WP-CLI flush-url actions automatically purge Cloudflare edge cache alongside local Redis.server/lumen-cache-proxy.php) on cache HITs, and updated Drop_In::write_config() to synchronize compiled pro_active state to deployed proxy files.from_tab retention to the Cloudflare purge form on the Cache Controls page, keeping administrators on their current tab after purging.wp-admin/index.php after flushing cache via redirect_to handling, complete with dismissible success notice and refined button hover styling.wp lumencache status with --format support (table, json, yaml, csv) and drop-in / WP_CACHE status visibility; aligned flush-url output with semantic WP-CLI warning conventions.wc_load_cart) during REST API user-state hydration requests; added LifterLMS course-progress resolution support.lumencache_user_state_keys and lumencache_resolve_user_state_{$key} filters for developer extensibility.X-WP-Nonce header authentication across REST user-state hydration and Admin Bar AJAX flush handlers.lumencache_test_redis) supporting both phpredis and Predis drivers, Unix sockets, host/port, database indexes, connection timeouts, and authentication passwords.history.replaceState) on sidebar tab switches, preventing stale tab states across page reloads.tab and from_tab state retention across all admin actions (cache flushes, drop-in deployment, settings save, salt save, and rewrite operations), preserving the user's active view after every submission.cache:) when clearing key prefix.Settings::reset_cache() method to reset in-process configuration memory.nginx_map_block() and sample Nginx configurations with wp-postpass_ and comment_author_ cookie bypass rules, preventing cached responses for unlocked password-protected posts and returning commenters..htaccess rewrite rules to directly exclude /feed/ requests and XML sitemaps before proxy evaluation, avoiding unnecessary PHP execution overhead.wp-postpass_ and comment_author_ cookie rewrite conditions to .htaccess configuration.Htaccess::deploy_proxy() to verify and ensure target upload directory existence with wp_mkdir_p().\Redis::OPT_READ_TIMEOUT, Predis read_write_timeout, and comment_author_ cookie bypass across both server/lumen-cache-proxy.php and server/advanced-cache.php.\Redis::OPT_READ_TIMEOUT) and Predis (read_write_timeout) to protect PHP worker processes from hanging on stalled Redis operations.key_count() to eliminate redundant full-keyspace SCAN operations across admin page views.delete() and delete_pattern() against PHP 8.1+ argument unpacking errors by guaranteeing integer-indexed array keys with array_values().memory_used() across both phpredis and Predis drivers for accurate RAM usage reporting.reconnect() and get_prefix() helper methods to Redis_Connector.clear_active_cookie()) when WooCommerce cart is emptied or subscriptions stop, ensuring sys_active_state cookie is preserved while user remains logged in./wc-api/ to safeguard payment gateway callbacks and webhooks from being cached.woocommerce_variation_set_stock to immediately purge stale caches when variable product inventory levels are updated.send_cookie() with reverse proxy HTTPS detection via HTTP_X_FORWARDED_PROTO.wp-postpass_ cookie).error_get_last()) during output buffer capture to guarantee broken pages or fatal errors are never written to cache.transition_post_status) so unpublishing or trashing a post immediately clears its cached HTML from Redis.comment_post, edit_comment, wp_set_comment_status, delete_comment, trashed_comment, spammed_comment) and created_term.lumen-cache-proxy.php) with complete feed bypass rules (/feed/ and ?feed=) to prevent XML feeds from caching as HTML.advanced-cache.php and lumen-cache-proxy.php to cover core WordPress (wp-sitemap), standard sitemaps (sitemap_index), and paginated variants.wp-content/uploads/lumen-cache-proxy.php on file deployment and settings save.server/lumen-cache-proxy.php.Htaccess::deploy_proxy() to automatically configure localized ABSPATH definitions upon file deployment.advanced-cache.php is now completely self-contained with compiled configuration snapshot data.assets/css/admin.css to prevent connector lines from overlapping labels.lumen-cache-proxy.php with native PHP casts since the proxy runs pre-bootstrap.LUMENCACHE_PROXY_ABSPATH) for WordPress index.php and wp-config.php inclusion.$redis->auth() and $redis->select() in connect_phpredis().LUMENCACHE_DEBUG check for zero production overhead.advanced-cache.php with native PHP casts and isset checks.enable_wp_cache() string replacement logic for reliable WP_CACHE insertion into wp-config.php.Lifecycle::uninstall() now flushes all Redis keys before removing plugin files.ABSPATH check to all server drop-ins.$_SERVER inputs across pre-bootstrap request paths.Content-Type: text/html response headers.esc_url_raw().WP_CACHE states in wp-config.php and automated cleanup on deactivation.SCAN cursor handling in key_count() and delete_pattern().connect_phpredis() and refined Unix socket handling.advanced-cache.php drop-in deployment with zero server configuration requirements.