| 开发者 |
nasruleam
celsiusanderson |
|---|---|
| 更新时间 | 2026年10月6日 17:57 |
| 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).
/wp-json/lumencache/v1/user-state to gracefully isolate guest-safe keys (cart-count, cart-total) when unauthenticated requests contain mixed-key requests (such as headers rendering both cart widgets and member greetings), preventing 403 authorization rejections from breaking guest cart hydration.Educational_Products_LMS_Progress) and Sensei LMS, alongside existing LearnDash and LifterLMS integrations; added lumencache_resolve_course_progress and lumencache_enqueue_hydration_script filters.skeleton-hydration.js to dynamically update progress bar widths (role="progressbar", .lms-progress-bar, .progress-bar) and support data-lumencache-suffix attributes; exposed window.lumenCacheHydrate API and registered lumencache:rehydrate event listener for AJAX catalog pagination and mini-cart drawers.wp lumencache flush-all subcommand alias, --url=<url> flag support for flush-url, and enriched wp lumencache status with HTTP 304 ETag status, Speculation Rules API state, storage driver, SWR grace periods, browser cache TTL, Apache/LiteSpeed RAM Proxy status, and Pro status.wp lumencache deploy-dropin, wp lumencache remove-dropin, wp lumencache write-htaccess, and wp lumencache remove-htaccess subcommands for automated headless server provisioning and CI/CD pipelines.lc_is_pro_active() and lc_has_pro_feature() legacy function aliases; added dual hook dispatching for all five Pro administrative sections (lc_render_pro_* and lumencache_render_pro_*); added legacy lumencache_render_pro_panel() and lc_render_pro_panel() compatibility bridges.from_tab hidden inputs across Settings, Cache Controls (Flush All, Purge URL), and Server Setup action forms, guaranteeing that all form submissions and admin-post actions reliably redirect administrators back to their active working tab.handle_htaccess_write() to validate WP_Error return states from Htaccess::write_rules(), passing distinct error notices with diagnostic messages instead of reporting false positive success on filesystem permission failures; added distinct htaccess=removed handling for rule deletions.Cookie_Router::set_active_cookie() to immediately mirror active state into superglobal $_COOKIE['sys_active_state'] = 'true', ensuring all downstream checks and speculation suppression evaluate correctly within the identical PHP lifecycle.woocommerce_cart_item_removed listener to Cookie_Router, automatically clearing sys_active_state and restoring high-speed RAM caching when a guest shopper removes the final item from their cart.Cookie_Router::send_cookie() with full reverse proxy and Cloudflare SSL awareness (HTTP_X_FORWARDED_SSL, HTTP_CF_VISITOR), guaranteeing correct Secure attribute propagation.Speculation_Rules::should_render() with comprehensive suppression checks for DONOTCACHEPAGE, woocommerce_cart_hash, native WooCommerce checkout/account templates (is_cart(), is_checkout(), is_account_page()), and password-protected posts./cart, /checkout, /my-account paths, archive mime types (.tar*, .gz*), and link downloads (a[download]).Woo_Guard::maybe_short_circuit_fragments() with query parameter sanitization (sanitize_text_field( wp_unslash( ... ) )).Redis_Connector::set()), preventing database churn and maintaining 15-second key count caching exclusively for the administrative dashboard.$capture_buffer_level) in Cache_Engine, safely collapsing unclosed third-party template and widget buffers prior to cache capture.E_RECOVERABLE_ERROR, guaranteeing incomplete or faulted pages are never committed to cache.page_for_posts) and post author archives (get_author_posts_url), ensuring archives immediately reflect newly published and updated articles.purge_post() and purge_url() to invalidate both trailing-slashed and unslashed canonical Redis keys in a single atomic batched DEL command.HTTP_X_FORWARDED_SSL and Cloudflare HTTP_CF_VISITOR payloads across write paths and URL purges.Lifecycle::deactivate() and Lifecycle::uninstall() to automatically flush Redis cache keys and clean up all transient caches (lumencache_key_count, lumencache_nginx_confirmed, lumencache_qs_bridge_check).Redis_Connector::key_count() and delete_pattern() to defend against runaway driver loops during full-keyspace cursor traversal.<script type="speculationrules">) delivering sub-50ms instant page navigation via Chromium background prefetching and prerendering, fully accelerated by sub-millisecond RAM cache delivery.If-None-Match validation directly into early drop-in and proxy readers, terminating repeat requests with HTTP 304 Not Modified and 0 bytes transfer.Cache-Control: public, max-age=..., stale-while-revalidate=... headers for browser caches and edge CDN proxies.ext-redis PHP extension. Both advanced-cache.php and server/lumen-cache-proxy.php now detect and load LumenCache's bundled Predis autoloader (wp-content/plugins/lumen-cache/vendor/autoload.php) before early bail-out checks.ext-redis PHP extension. Both advanced-cache.php and server/lumen-cache-proxy.php now detect and load LumenCache's bundled Predis autoloader (wp-content/plugins/lumen-cache/vendor/autoload.php) before early bail-out checks.advanced-cache.php, lumen-cache-proxy.php, and class-cache-engine.php with 0 transport latency.Drop_In::deploy() template to preserve the bundled autoloader fallback on redeployments and settings compiles.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.