litespeed cache conflict with polylang
-
i am having problem with litespeeds and polylang. when i enable both plugins. litespeed cache can not create cache on my home page. is there any way to solve this problem?
-
@tranqdu
Please give more details about the issue. What do you mean “cannot create cache”
And create a report and share the ID. This can be done from: LSC => Toolbox => Reports => click on “send to litespeed”Website: https://wandleinwand.com
LiteSpeed Cache version: 7.1
Polylang version: 3.7.3
Web server: OpenLiteSpeed
When using Polylang with LiteSpeed Cache, the homepage (https://wandleinwand.com) is not being cached, while all other pages are cached normally.
Header response on homepage shows:
X-LiteSpeed-Cache: miss
or sometimes X-LiteSpeed-Cache: no-cache.ID report : USMROWRZ
Please advise how to make the homepage cacheable when Polylang is configured to hide the language slug for the default language. It seems LiteSpeed Cache cannot detect the language context on
wandleinwand.com(without a/de/or/en/in the URL), so it doesnโt create cache.@tranqdu
Thank you for info provided.My first thoughts are because of a plugin that disables cache on pages is used.
Let’s start debugging
1) In edit page make sure the page has NOT active Do not cache.
2) Links are not added here: https://docs.litespeedtech.com/lscache/lscwp/cache/#do-not-cache-uris
3) Enable Debug Log from https://docs.litespeedtech.com/lscache/lscwp/toolbox/#debug-log and set it to Advanced.
Open incognito page and visit homepage
Go back to LSC => Toolbox => Log view https://docs.litespeedtech.com/lscache/lscwp/toolbox/#log-view-tab and make sure Debug Log is selected.
Search for ย ——POST HTTP/1.1 (HTTPS) / (homepage request) and there should say why is not cached.
Example of what could be:โ forced no cache [reason] DONOTCACHEPAGE const.This article will help with enabling debug: https://docs.litespeedtech.com/lscache/lscwp/troubleshoot/#turn-on-the-debug-log
-
This reply was modified 1 year ago by
litetim. Reason: extra data
i followed your instructions and it shows the logs :
05/29/25 19:10:21.357 [14.191.139.139:55756 1 IeV] [Core] CHK html bypass: miss footer const
05/29/25 19:10:21.357 [14.191.139.139:55756 1 IeV] ๐ต not cacheable before ctrl finalize
05/29/25 19:10:21.358 [14.191.139.139:55756 1 IeV] [Router] get_role: administrator
05/29/25 19:10:21.358 [14.191.139.139:55756 1 IeV] ๐ฑ role in vary_group [group] 99
05/29/25 19:10:21.358 [14.191.139.139:55756 1 IeV] ๐ฑ show_admin_bar_front: true
05/29/25 19:10:21.358 [14.191.139.139:55756 1 IeV] ๐ฑ admin bar : true
05/29/25 19:10:21.358 [14.191.139.139:55756 1 IeV] ๐ฑ no custimzed vary
05/29/25 19:10:21.358 [14.191.139.139:55756 1 IeV] ๐ต โ forced no cache [reason] DONOTCACHEPAGE const
05/29/25 19:10:21.358 [14.191.139.139:55756 1 IeV] ๐ฐ X-LiteSpeed-Cache-Control: no-cache
05/29/25 19:10:21.358 [14.191.139.139:55756 1 IeV] ๐ฐ Cache-Control: no-cache, no-store, must-revalidate, max-age=0
05/29/25 19:10:21.358 [14.191.139.139:55756 1 IeV] ๐ฑ uid: 8
05/29/25 19:10:21.358 [14.191.139.139:55756 1 IeV] ๐ฑ role in vary_group [group] 99
05/29/25 19:10:21.358 [14.191.139.139:55756 1 IeV] ๐ฑ show_admin_bar_front: true
05/29/25 19:10:21.358 [14.191.139.139:55756 1 IeV] ๐ฑ admin bar : true
05/29/25 19:10:21.358 [14.191.139.139:55756 1 IeV] [footer comment]
<!-- Page uncached by LiteSpeed Cache 7.1 on 2025-05-29 19:10:21 -->
<!-- X-LiteSpeed-Cache-Control: no-cache -->
<!-- Full varies: admin_bar:1;logged-in:1;role:99 -->
05/29/25 19:10:21.358 [14.191.139.139:55756 1 IeV] [Core] CHK html bypass: miss footer const
05/29/25 19:10:21.358 [14.191.139.139:55756 1 IeV] [Core] run hook litespeed_buffer_finalize
05/29/25 19:10:21.358 [14.191.139.139:55756 1 IeV] Response headers --- array (
0 => 'X-Redirect-By: WordPress',
1 => 'Location: https://wandleinwand.com/wp-admin/admin.php?page=litespeed-toolbox',
2 => 'X-LiteSpeed-Cache-Control: no-cache',
3 => 'Cache-Control: no-cache, no-store, must-revalidate, max-age=0',
)
05/29/25 19:10:21.358 [14.191.139.139:55756 1 IeV] End response
--------------------------------------------------Duration: 172.25 ms------------------------------
05/29/25 19:10:21.633 [14.191.139.139:55756 1 XE7] ๐ ------GET HTTP/1.1 (HTTPS) /wp-admin/admin.php
05/29/25 19:10:21.633 [14.191.139.139:55756 1 XE7] Query String: page=litespeed-toolbox
05/29/25 19:10:21.633 [14.191.139.139:55756 1 XE7] HTTP_REFERER: https://wandleinwand.com/wp-admin/admin.php?page=lite...
05/29/25 19:10:21.633 [14.191.139.139:55756 1 XE7] User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit...
05/29/25 19:10:21.633 [14.191.139.139:55756 1 XE7] Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7
05/29/25 19:10:21.633 [14.191.139.139:55756 1 XE7] Accept Encoding: gzip, br
05/29/25 19:10:21.633 [14.191.139.139:55756 1 XE7] Cookie _lscache_vary: admin_bar:1;logged-in:1;role:99
05/29/25 19:10:21.633 [14.191.139.139:55756 1 XE7] X-LSCACHE: true
05/29/25 19:10:21.633 [14.191.139.139:55756 1 XE7] LSCACHE_VARY_COOKIE: pll_language,,wp-postpass_1087b1c562630b10ffdc185f85a60eb1
05/29/25 19:10:21.633 [14.191.139.139:55756 1 XE7] [ESI] Overwrite wp_create_nonce()
05/29/25 19:10:21.760 [14.191.139.139:55756 1 XE7] ๐ฎ No cache due to Admin page
05/29/25 19:10:21.786 [14.191.139.139:55756 1 XE7] [Media] init
05/29/25 19:10:21.786 [14.191.139.139:55756 1 XE7] [LQIP] init
05/29/25 19:10:21.786 [14.191.139.139:55756 1 XE7] [CDN] init
05/29/25 19:10:21.786 [14.191.139.139:55756 1 XE7] [Router] CDN bypassed: is not ajax call
05/29/25 19:10:21.786 [14.191.139.139:55756 1 XE7] [Router] CDN bypassed: ajax call from admin
05/29/25 19:10:21.786 [14.191.139.139:55756 1 XE7] โฐ Init
05/29/25 19:10:21.786 [14.191.139.139:55756 1 XE7] [Router] LSCWP_CTRL bypassed emptyThank you about log but is not complete. ๐
You can share full logs on: https://pastebin.ubuntu.com/ and paste the id only.
Thank you ๐please check for me here is the logs link : https://pastebin.ubuntu.com/p/hfS4F85jjP
@tranqdu please do not look for DONOTCACHEPAGE const
The logs are still trimmed.
Add this code in theme functions.php:add_filter('litespeed_debug_show_max_lines', 'lsc_log_change_lines');function lsc_log_change_lines(){return 10000; }
will allow to see more lines.I followed your instructions and got the result at the following link: https://pastebin.ubuntu.com/p/myvfHr45HP
please try this:
debug log to ON
debug level to advance
debug include URI , add
testclean up existing log
then open page as
https://wandleinwand.com/?testand share the log again
i did it your way. and here is the error log. is there really a way to fix this problem?
the log still not correct, please create a new report again , I will verify and double check your debug setting.
please check for me . i followed your instructions . link : https://pastebin.ubuntu.com/p/JGpSGJcYqC/06/02/25 17:07:31.699 [14.191.139.182:52262 1 oTq] ๐ต โ forced no cache [reason] DONOTCACHEPAGE const
06/02/25 17:07:31.699 [14.191.139.182:52262 1 oTq] ๐ฐ X-LiteSpeed-Cache-Control: no-cache,esi=onsorry for late response , it is indeed caused by that constant
please try
add_filter( 'litespeed_const_DONOTCACHEPAGE', '__return_false' );Thanks. It’s working fine again.
@tranqdu that is a good fix from @qtwrk , your site will run good, but I would dig into why the constant is set.
But I would look further into why the constantDONOTCACHEPAGEis set:
– maybe page is removed from cache
– maybe a plugin add the constant for homepage OR in some conditions
If everything is ok, please set the topic Resolved. Thank you ๐ -
This reply was modified 1 year ago by
The topic ‘litespeed cache conflict with polylang’ is closed to new replies.