Differences

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
Next revision Both sides next revision
litespeed_wiki:cache:lscwp:troubleshooting:general [2018/07/19 16:12]
Jackson Zhang
litespeed_wiki:cache:lscwp:troubleshooting:general [2020/05/04 13:47]
Shivam Saluja
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. Please follow these steps first before logging any ticket with us since your issue might have been resolved. ​ 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. ​
 +
 +Once you've looked through this guide, if you still need help, please see [[litespeed_wiki:​cache:​lscwp:​support|our support options]].
 +
 +===== Verify the Issue is Related to LSCache =====
 +
 +  - 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.
 +
 +Are you still having a problem? Then it is //not// an LSCache issue.
  
 ===== Are you still using an old version of LSWCP? ===== ===== Are you still using an old version of LSWCP? =====
  
-Our LSWCP plugin has been developed at a very fast pace. Some compatibility ​issue with other plugins/or break message ​may have already been fixed in the latest version. ​ You should always upgrade to the latest version ​and advice us which LSWCP you are using.+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.
  
-===== Image optimization problem? ​===== +===== Common Issues ​=====
-Please check out [[litespeed_wiki:​cache:​lscwp:​troubleshooting:​image_optimize_error|image optimization guide]] first to resove your issue. ​+
  
-   +==== LSCache Compatibility ​==== 
-===== Logged-in Users Appearing as Logged-out/​Multi site issue =====+If a page fails to load or does not load correctly, you may have a compatibility problem. Here'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 a new feature, you will need to Purge All and refresh browser. 
 +    - If no, the compatibility issue is probably not related to LSCache
  
-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]].+==== CSS/JS Optimization ==== 
 +Try the following steps to pinpoint CSS and JavaScript errors:
  
-===== Page Content Not Updating Correctly =====+  - Turn off optimization. From 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**. 
 +  - Purge the cache. Navigate to **LiteSpeed Cache > Manage > Purge** and press the **Purge All** button. 
 +  - Check your site. Reload 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]]
  
-If your site uses a plugin that updates the content of a page without editing/​saving that pagesuch as a "​like"​ button that updates a counter ​when pressed using ajaxLSCache will not be made aware that the page should be purged from cacheAs long as the now outdated copy of the page is still in cache and being served, it will appear like these changes never happened.+Note: Sometimeseven 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.
  
-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.+==== 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]].
  
-==== Testing ​====   +==== CDN Support ​==== 
-  - Purge the cache and with the inspector open (right click page -> Inspect) access the page as a guest/​non-logged in user. +You can narrow down CDN issues through ​the following steps: 
-  ​- 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". +  ​* Visit the CDN URL and verify that it is accessible 
-  ​- (If your plugin updates on each visit, skip this step) Refresh the page. You should now see "​X-LiteSpeed-Cachehit" in your response header. This indicates that the page was served from cache. +  ​* Check your [[litespeed_wiki:cache:​lscwp:​configuration:​cdn|CDN settings]] 
-  ​- Trigger your plugin ​and make sure that the page is updated as expected. +  ​* View Page Source, ​and verify ​that links are indeed pointing to the CDN URL.
-  - 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 ===== +==== LiteSpeed Cache is Disabled ​==== 
-Scheduled Posts are published in WordPress through ​WP cron job. NormallyWordPress triggers ​the cron job each time request hits the backend. The backend is rarely hit, however, when using a cache, which causes scheduled posts to publish late.+If you see warning that indicates LiteSpeed Cache is disabled, the warning itself may give clue as to the source of the problem.
  
-LSCWP will correctly purge the cache when a scheduled post is published in the cron jobAll you need to do is make sure that you can reliably hit the backend. This can be done by scheduling a cron job to hit wp-cron.php at your ideal interval.+=== The LSCache Module is disabled at the server level === 
 +This indicates that cache is turned off at the highest levelYou will need to [[litespeed_wiki:​cache:​lscwp:​installation|configure your server]], or have your hosting provider ​do it for you.
  
-For Example, to update scheduled posts every 15 minutes: +=== LiteSpeed Cache is disabled in the plugin settings === 
-<​code>​ +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.
-*/15 * * * * wget http://​your_wp_site/​wp-cron.php +
-</​code>​+
  
-When using server level cron jobWordPress suggests defining DISABLE_WP_CRON in your wp-config file to disable checking wp-cron on a backend hit. +=== LiteSpeed Cache is disabled === 
-<​code>​ +This is generic error that doesn'​t indicate any cause. ​ Navigate to **LiteSpeed Cache > Report** and look at the **Report Summary**. The ''​Server Variables''​ section right at the top can give you some helpful information. Check the values of the following variables:​ 
-define('​DISABLE_WP_CRON', true); +  * ''​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**. 
-</​code>​ +  * ''​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]]. 
-This may be useful in reducing ​the number of calls made to wp-cron if that is desired.+  * ''​LITESPEED_ON_IN_SETTING = true''​ - If this value is ''​NULL'',​ navigate to the **Settings > General** page and set **Enable LiteSpeed Cache** to ''​Enable''​
  
-[[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.]]+==== 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 WebPNot 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 ​=====+==== 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.
  
-===== Crawler Fails to Generate Sitemap File ===== +==== Forced Caching ​==== 
-If you generate a sitemap but notice that the crawler **Size** ​is still ''​1''​ or ''​2''​, you can try the 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 ideabecause ​you never know when there will be individual exceptions ​to caching.
  
-{{:​litespeed_wiki:​cache:​lscwp:​troubleshooting:​sitemap.png?800|}}+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.
  
-  - Verify that the sitemap ​URL works+==== Lazy Load ==== 
-  - Verify that the URLs within the sitemap are available for public visit. +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**
-    - If the URLs are only privatethat can cause a sitemap generation issue. + 
-  - Verify ​''​/wp-content/​plugins/​litespeed-cache/​var/​crawlermap*.data'' ​exists+Alternately,​ if you are a developeryou can add the attribute ​''​data-no-lazy="​1"​'' ​to the image in your HTML code
-    If it doesn'​t exist, there may be permission ​issue with one of the directories ​in the path. + 
-  - Verify that the [[litespeed_wiki:​cache:​lscwp:environment-report|environment]] ''​home_url''​ is identical ​to the home URL in Step 2Keep in mind that ''​<​nowiki>​http://example.com/test.html</nowiki>''​ and ''​<​nowiki>​https://example.com/​test.html</​nowiki>​'' ​are different! +==== Logged-in Users Appearing as Logged-out ==== 
-    ​Fix by changing **LiteSpeed Cache > Settings > General > Site Address (URL)** ​to match the value in the sitemap.+ 
 +This problem is caused when using multiple web applications under 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 itselfThis 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-Cachemiss''​ in the headers, then something is wrongSee 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-Cachemiss''​ to appear at all timesHowever, 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'':​ 
 + 
 +  RewriteRule .* - [E=Cache-Vary:​euCookie]
  
 ===== Provide Report Number ===== ===== Provide Report Number =====
  
-If someday ​you encounter a problem that requires ​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.+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]].
  
-To generate and share your Environment Report, navigate to LiteSpeed Cache > Environment Report. Press the "Send to LiteSpeed"​ button. ​ Check [[litespeed_wiki:​cache:​lscwp:​environment-report|here]] for details about such report. 
  • Admin
  • Last modified: 2020/11/14 15:43
  • by Lisa Clarke