This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Last revision Both sides next revision
litespeed_wiki:cache:lscwp:troubleshooting:general [2018/07/19 14:53]
Eric Leu [Why crawler failed to generate file]
litespeed_wiki:cache:lscwp:troubleshooting:general [2020/05/08 19:57]
Eric Leu
Line 1: Line 1:
-====== ​General ​Troubleshooting Guide For LSCWP ======+====== Troubleshooting Guide For LSCWP ====== 
 +**Please Note**: This wiki is valid for v2.9.x and below of the LiteSpeed Cache Plugin for WordPress. If you are using v3.0 or above, please see [[https://​docs.litespeedtech.com/​lscache/​lscwp/​overview/​|the new documentation]].
-Here are a few common issues and how to deal with them.+Here are a few common issues and how to deal with them. Please follow these steps first before logging any ticket with us since your issue might have been resolved
-===== Logged-in Users Appearing as Logged-out =====+Once you've looked through this guide, if you still need help, please see [[litespeed_wiki:​cache:​lscwp:​support|our support options]].
-This problem ​is caused when using multiple web applications under a single domain. You can find more information on this issue and how to resolve it in our [[litespeed_wiki:​cache:​common:​logged-in-cookie-conflicts|Handling Logged-in Cookie Conflicts page]].+===== Verify the Issue is Related ​to LSCache =====
-===== Page Content Not Updating Correctly =====+  - LSCache plugin should be activated 
 +  - LDCache should be enabled 
 +  - Navigate to **LiteSpeed Cache > Settings > Debug** and set **Disable All Features** to ''​ON''​ 
 +Is the issue gone? Then the issue is probably related to LSCache.
-If your site uses a plugin that updates the content of page without editing/saving that page, such as a "​like"​ button that updates a counter when pressed using ajax, LSCache will not be made aware that the page should be purged from cache. As long as the now outdated copy of the page is still in cache and being served, it will appear like these changes never happened.+Are you still having ​problem? Then it is //not// an LSCache issue.
-To fix this, you can add our ''​LiteSpeed_Cache_API::​purge_post($id)''​ [[litespeed_wiki:​cache:​lscwp:​api#​functions|API call]] to the offending plugin to have it notify LSCache that the page should be purged.+===== Are you still using an old version of LSWCP? =====
-==== Testing ====   +Our LSWCP plugin has been developed at a very fast pace. Some compatibility issues ​with other plugins may have already been fixed in the latest version.  You should ​always upgrade to the latest version before logging a ticket.
-  - Purge the cache and with the inspector open (right click page -> Inspect) access the page as a guest/​non-logged ​in user. +
-  - In the inspector, click into the Network tab and select the page request - this is usually the first entry. With this selected, click the Header tab and check that the Response Header does not contain "​X-LiteSpeed-Cache:​ hit". +
-  - (If your plugin updates on each visit, skip this step) Refresh the page. You should ​now see "​X-LiteSpeed-Cache:​ hit" in your response header. This indicates that the page was served from cache. +
-  - Trigger your plugin and make sure that the page is updated as expected. +
-  - Refresh the page one last time. "​X-LiteSpeed-Cache:​ hit" should once again be gone from the Response Header and the page should still contain the updated information+
-===== Scheduled Posts Not Publishing On Time ===== +===== Common Issues ​=====
-Scheduled Posts are published in WordPress through a WP cron job. Normally, WordPress triggers the cron job each time a request hits the backend. The backend is rarely hit, however, when using a cache, which causes scheduled posts to publish late.+
-LSCWP will correctly ​purge the cache when scheduled post is published in the cron job. All you need to do is make sure that you can reliably hit the backend. This can be done by scheduling ​cron job to hit wp-cron.php at your ideal interval.+==== LSCache Compatibility ==== 
 +If a page fails to load or does not load correctly, you may have compatibility problemHere's how to check which feature of the plugin causes the issue: 
 +  - Keep LiteSpeed Cache plugin activated 
 +  - Set **LiteSpeed Cache > Settings > Debug > Disable ​All Features** ​to ''​ON''​ 
 +  - Refresh ​the page see if it loads correctly 
 +    - If yes, turn on the cache and optimization functions one by one. Each time you turn on new feature, you will need to Purge All and refresh browser. 
 +    - If no, the compatibility issue is probably not related to LSCache
-For Example, ​to update scheduled posts every 15 minutes: +==== CSS/JS Optimization ==== 
-<​code>​ +Try the following steps to pinpoint CSS and JavaScript errors:
-*/15 * * * * wget http://​your_wp_site/​wp-cron.php +
-When using a server level cron job, WordPress suggests defining DISABLE_WP_CRON in your wp-config file to disable checking wp-cron on a backend hit. +  ​Turn off optimizationFrom the WordPress Dashboard, navigate to **LiteSpeed Cache Settings > Optimize** and set all of the following to OFF: **CSSMinify****CSS Combine**, **CSS HTTP/2 Push**, **JS Minify**, **JS Combine**, **JS HTTP/2 Push**. 
-<code> +  - Purge the cache. Navigate ​to **LiteSpeed Cache > Manage > Purge** and press the **Purge All** button. 
-define('​DISABLE_WP_CRON'​true); +  ​Check your siteReload the page. Does it still look bad? If no, follow [[https://​www.litespeedtech.com/​support/​wiki/​doku.php/​litespeed_wiki:​cache:​lscwp:​optimization-troubleshooting|wiki]]
-</code> +
-This may be useful in reducing ​the number of calls made to wp-cron if that is desired.+
-[[https://blog.litespeedtech.com/​2017/​05/​17/​wpw-using-lscache-for-wp-with-scheduled-posts/​|For a more in-depth discussion ​of this issue, see our blog.]]+NoteSometimes, even when Critical CSS is enabled, the site may flash unstyled content during loadThis is because the CSS file is not yet loaded due to Asynchronous loading ​of CSS. This is especially an issue in FireFox.
-===== Some CSS Files Not Properly Reloaded After Update ​=====+==== Image Optimization ==== 
 +There are a few different kinds of errors that you may see when optimizing images. Take a look at [[litespeed_wiki:​cache:​lscwp:​troubleshooting:​image_optimize_error|Image Optimization Errors]]. 
 +==== CDN Support ==== 
 +You can narrow down CDN issues through the following steps: 
 +  * Visit the CDN URL and verify that it is accessible 
 +  * Check your [[litespeed_wiki:​cache:​lscwp:​configuration:​cdn|CDN settings]] 
 +  * View Page Source, and verify that links are indeed pointing to the CDN URL. 
 +==== LiteSpeed Cache is Disabled ==== 
 +If you see a warning that indicates LiteSpeed Cache is disabled, the warning itself may give a clue as to the source of the problem. 
 +=== The LSCache Module is disabled at the server level === 
 +This indicates that cache is turned off at the highest level. You will need to [[litespeed_wiki:​cache:​lscwp:​installation|configure your server]], or have your hosting provider do it for you. 
 +=== LiteSpeed Cache is disabled in the plugin settings === 
 +This indicates that you haven'​t turned on caching in the plugin settings. [[litespeed_wiki:​cache:​lscwp:​configuration:​general#​enable_litespeed_cache|Do so]], and the problem should be solved. 
 +=== LiteSpeed Cache is disabled === 
 +This is a generic error that doesn'​t indicate any cause. ​ Navigate to **LiteSpeed Cache > Toolbox > Report** and look at the **System Information**. The ''​Server Variables''​ section right at the top can give you some helpful information. Check the values of the following variables:​ 
 +  * ''​LSCACHE_ADV_CACHE = true''​ - If this value is ''​NULL'',​ look for the ''​wp-content/​advanced-cache.php''​ file which should include the line ''​define('​LSCACHE_ADV_CACHE',​ true);''​. If the line exists, then it may be a permissions issue. Simply fix by removing the ''​advanced-cache.php''​ file, and deactivating and reactivating the LiteSpeed Cache plugin. The file will be correctly regenerated. **NOTE:** Sometimes you do this, and the plugin still doesn'​t work. In this case, Navigate to **LiteSpeed Cache > Settings > Advanced** and disable **Check Advanced Cache**. 
 +  * ''​LITESPEED_ON = true''​ - If ''​LSCACHE_ADV_CACHE = null'',​ then this will //always// be ''​NULL''​. Otherwise, if this value is ''​NULL'',​ it means that you are not running with LiteSpeed Web Server. This is allowed, but it limits the functions that you are able to use. [[litespeed_wiki:​cache:​lscwp:​installation|Learn more]]. 
 +  * ''​LITESPEED_ON_IN_SETTING = true''​ - If this value is ''​NULL'',​ navigate to the **Settings > General** page and set **Enable LiteSpeed Cache** to ''​Enable''​ 
 +==== WebP Images Not Loading ==== 
 +If you've generated WebP images through Image Optimization,​ but they are not showing on the front end, try these steps: 
 +  - Make sure you are using a browser that supports WebP. Not all of them do. 
 +  - Navigate to **Litespeed Cache > Settings > Media** and make sure that the **Image WebP Replacement** option is set to ''​ON''​. 
 +  - If it's on, then from **Settings > Debug**, set **Debug Log** to ''​ON''​ and **Debug Level** to ''​Advanced''​. Clear the cache, load your page, and check the debug log. Don't forget to turn the log off again when you are finished troubleshooting. 
 +  - If the debug log doesn'​t offer any explanation,​ try disabling and re-enabling WebP replacement. Sometimes that can fix this issue. 
 +==== Some CSS Files Not Properly Reloaded After Update ====
 Most likely, this is not an LSCache issue, since LSCWP doesn'​t cache static files. Most likely, this is not an LSCache issue, since LSCWP doesn'​t cache static files.
 If your theme'​s CSS is not properly loaded after an update, check your browser cache. Does the reload work? Do you have a CDN or a reverse proxy in front of your webserver, such as CloudFlare? These caching mechanisms may need to be purged. See [[https://​www.litespeedtech.com/​support/​forum/​threads/​wordpress-css-not-reloading.15588/#​post-99620|this forum post]] for more details. If your theme'​s CSS is not properly loaded after an update, check your browser cache. Does the reload work? Do you have a CDN or a reverse proxy in front of your webserver, such as CloudFlare? These caching mechanisms may need to be purged. See [[https://​www.litespeedtech.com/​support/​forum/​threads/​wordpress-css-not-reloading.15588/#​post-99620|this forum post]] for more details.
-===== Why crawler failed ​to generate file ===== +==== Forced Caching ​==== 
-If you generate sitemap but see crawler still Size or 2. You can try following steps to debug the issue.+Sometimes, in an effort ​to make sure that certain pages are always cached, you erroneously force the //entire site// to be cached. Forcing this is not a good idea, because you never know when there will be individual exceptions to caching. 
 +Navigate to **LiteSpeed Cache > Settings > Excludes** and look in the **Force Cache URIs** box. If you see ''/''​ or ''​*''​ there, then you will need to remove it. Save, and then Purge All LSCache. 
 +==== Lazy Load ==== 
 +If you find some images should not be lazy loaded, you can exclude them in **LiteSpeed Cache > Settings > Media**. Add the URL to **Lazy Load Image Excludes**. 
 +Alternately,​ if you are a developer, you can add the attribute ''​data-no-lazy="​1"''​ to the image in your HTML code. 
 +==== Logged-in Users Appearing as Logged-out ==== 
 +This problem is caused when using multiple web applications under a single domain. You can find more information on this issue and how to resolve it in our [[litespeed_wiki:​cache:​common:​logged-in-cookie-conflicts|Handling Logged-in Cookie Conflicts page]]. 
 +==== A Scheduled Event has Failed ===== 
 +The following notice may appear in the Health Check plugin: ''​The scheduled event, litespeed_xxxx[image or ccss]_trigger,​ failed to run, Your site still works, but this may indicate that scheduling posts or automated updates may not work as intended''​ 
 +For example:  
 +  "The scheduled event, litespeed_imgoptm_trigger,​ failed to run."​ 
 +Technically,​ this is not a LiteSpeed issue, but is due to WordPress itself. This usually happens when WP does a version update. It will usually clear up on its own in a day or so, once the WP-Cron is back to normal. 
 +If you don't want to wait, you can disable WP-Cron and use a 3rd party cron like cPanel cron. 
 +===== Advanced Issues ===== 
 +==== Cache Always Misses ==== 
 +If you always see ''​X-LiteSpeed-Cache:​ miss''​ in the headers, then something is wrong. See if any of the following steps help: 
 +  * Disable and then re-enable LSCache. 
 +  * In the **Debug** settings tab, disable **Check Advanced Cache**. 
 +  * Verify that the cache directory (found in ''​wp-content/​cache''​) has the proper permissions (0755) 
 +  * Some CDNs have cache settings that can break LSCache and cause ''​X-LiteSpeed-Cache:​ miss'' ​to appear at all times. However, accessing ​the backend server directly achieves ''​X-LiteSpeed-Cache:​ hit''​. If this happens, turn off the CDN's cache functions.  
 +==== Currency/​Language Switcher Plugins ==== 
 +Because these plugins are mostly PHP session-based,​ there'​s no way to fix the caching on our end. The plugin author needs to change their code to be compatible with LSCache. [[/​litespeed_wiki:​cache:​lscwp:​api|See the API]] for more information on how to do that. 
 +==== EU Cookie Consent ==== 
 +If you have EU Cookie Consent on your site, you will need a cache vary. Varying on the cookie allows two versions of each page to be stored in cache - one for people who have consented to the cookie, and one for those who have not yet done so. 
 +Add the following line to ''​.htaccess'':​
-{{:litespeed_wiki:​cache:​lscwp:​troubleshooting:​sitemap.png?​800|}}+  RewriteRule .* - [E=Cache-Vary:euCookie]
-  - Step 1. Verify sitemap URL works +===== Provide Report Number =====
-  - Step 2. Verify any URL's of sitemap is able for public visit +
-    - Fix: If only visible for private may cause sitemap generate issue  +
-  - Step 3. Verify ''/​wp-content/​plugins/​litespeed-cache/​var/​crawlermap*.data''​ exist (Optional) +
-    - Fix: Probably a permission issue +
-  - Step 4. Verify [[https://​www.litespeedtech.com/​support/​wiki/​doku.php/​litespeed_wiki:​cache:​lscwp:​environment-report | environment]] ''​home_url''​ is identical to Step 2's URL. e.g. http://​example.com/​test.html https://​example.com/​test.html are different. +
-    - Fix: Change Settings>​General>​Site Address (URL) value to match sitemap.+
 +If you have been through these troubleshooting steps, and you still require support, we may ask to see your Environment Report. The Environment Report tells us what settings you have enabled, what other plugins you have installed, and the contents of your ''​.htaccess''​ file, among other useful things.
 +To generate and share your Environment Report, navigate to **LiteSpeed Cache > Report**. Press the **Send to LiteSpeed** button. ​ You can learn more about the Environment Report ​ [[litespeed_wiki:​cache:​lscwp:​environment-report|here]].
  • Admin
  • Last modified: 2020/11/14 15:43
  • by Lisa Clarke