连续两次点击WordPress站点链接导致空白页面问题求助
Hey there, let's break down this tricky blank page issue you're dealing with. Since you've already ruled out plugins and themes by disabling all plugins and switching to a default theme, we can focus on server-side, caching, or configuration-specific problems tied to Azure and your WordPress 4.9.5 setup.
1. Check for Azure-Specific Caching Misbehavior
This second-click blankness screams cached empty response—Azure has several caching layers that might be misconfigured:
- Disable App Service Output Caching: Head to your Azure Portal → App Service → Configuration → General settings. Look for the "Output caching" option and toggle it off temporarily to test if the issue goes away.
- Purge Azure CDN Cache: If you're using Azure CDN, clear the entire cache. Also, double-check your CDN caching rules to ensure dynamic WordPress pages (not just static assets like images/CSS) aren't being cached incorrectly.
- Force Disable WP Built-in Cache: Add this line to your
wp-config.phpfile if you haven't already:define('WP_CACHE', false);
2. Increase PHP Limits and Enable Server-Side Logging
Even without frontend errors, the second request might be hitting memory or execution limits silently:
- Boost WordPress Memory Limits: Update your
wp-config.phpwith these lines:define('WP_MEMORY_LIMIT', '256M'); define('WP_MAX_MEMORY_LIMIT', '512M'); - Adjust Azure PHP Settings: Go to App Service → Configuration → General settings → PHP version, then click "Edit PHP.ini configuration". Set:
After setting the error log, trigger the blank page again and check themax_execution_time = 60 memory_limit = 256M error_log = /home/site/wwwroot/php_errors.logphp_errors.logfile for hidden errors.
3. Resolve Session Storage Conflicts
If your Azure App Service is scaled to multiple instances, local session storage can cause inconsistencies between requests:
- Check WP Session Config: Temporarily comment out any custom session-related lines in
wp-config.php(likeWP_SESSION_COOKIEdefinitions) to see if that fixes the issue. - Use Shared Session Storage: If you're running multiple App Service instances, configure session storage to use Azure Redis Cache or a shared database instead of local instance storage. This ensures sessions persist across all instances.
4. Repair Corrupted WordPress Core Files
Even after updating to 4.9.5, core files might have been corrupted during deployment:
- Re-download the exact WordPress 4.9.5 package, then replace the
wp-adminandwp-includesfolders on your server (make sure to keep yourwp-contentfolder andwp-config.phpintact). - Clear your browser cache and any remaining server cache, then test the double-click scenario again.
5. Use Azure's Built-in Logging Tools
Don't rely solely on wp_debug—Azure's logging can catch server-side issues the frontend doesn't show:
- Log Stream: Go to App Service → Log stream, then trigger the blank page. Watch for 500 errors, PHP warnings, or database connection issues that might occur on the second request.
- Application Insights: Enable Application Insights for your App Service. It will track request failures and provide detailed traces of what's happening behind the scenes during problematic requests.
Let me know if any of these steps point you to the root cause—intermittent issues like this are almost always tied to caching or server configuration quirks, especially on Azure's platform.
内容的提问来源于stack exchange,提问作者DLzer

