[solved] LiteSpeed cache stopped working after upgrading the LiteSpeed

#1
Hello,

After upgrading to "5.2.6" the LS caching seems to be not working anymore.

A Good example would be :
https://www.webpagetest.org/result/180502_B2_0a51048c44a39b6c913552413ba7c557/

Previously the First Byte Time was about 0.6-0.8s but now its about 5s which is totally ridiculous. And when we try to load the pages as guests they load super slow as its shown in the test results.

Please note that prior to the update the fully loaded time was around 3-3.5s.

I would appreciate any help.


PS: upgrading to "5.2.7" did not solve anything.


Thank you in advanced.
 
Last edited by a moderator:

Unique_Eric

Administrator
Staff member
#2
Hi A.Chakery,
Possible site running by Apache web server?
Could you paste response header from browser developer tool? Should be in Network->Document->Response Header
 
#3
Dear Unique_Eric,
Thank you for your reply.

Yes, we are definitely on LiteSpeed.

I am not very experienced with linux and we have ServerAdmins, but as far as I know we are on LiteSpeed.

This is the response results from my terminal and its LiteSpeed. Interestingly the LiteSpeed cache control is also seems to be active but practically not working.

Code:
< date: Thu, 03 May 2018 12:31:56 GMT
< content-type: text/html; charset=UTF-8
< set-cookie: __cfduid=dfdd0bc9d22804a436f6abe6a033035c51525350714; expires=Fri, 03-May-19 12:31:54 GMT; path=/; domain=.serialcart.com; HttpOnly
< link: <https://serialcart.com/?p=46>; rel=shortlink
< set-cookie: woocommerce_recently_viewed=46; path=/; domain=.serialcart.com
< x-litespeed-cache-control: public,max-age=604800
< x-litespeed-tag: 93b1_URL.598cd2f215ecaea656415ad555eb49a7,93b1_Po.46,93b1_
< vary: Accept-Encoding,Origin
< alt-svc: quic=":443"; ma=2592000; v="35,37,38,39"
< x-turbo-charged-by: LiteSpeed
< expect-ct: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
< server: cloudflare
< cf-ray: 4152bf4d7c99597e-VIE

Thank you again
 

Unique_Eric

Administrator
Staff member
#4
Hm, seems cache not working.
No `x-litespeed-cache` tag and source page is not generated by cache.
Could you provide report number by Navigate to **LiteSpeed Cache > Report**, press the **Send to LiteSpeed** button, and let us know what it says under "Report Number." We'll be able to access the report from here and get some information about your configuration that might be helpful.
 
#5
Sorry for the delayed reply, I was waiting for our server admin reply regarding this issue.
This is our report number : FRYMLWZY

Thank you again
 
#6
Followup:

Our server admins solved this issue however I would appreciate if you provide us with more details on what has caused this issue ?

Thank you
 

NiteWave

Administrator
#7
usually it's permission of cache root not set correctly.
in cPanel server, it's /home/user/lscache. owner:group should be nobody:user (NOT user:nobody)
yes, only your host or server admin can fix it.
 
#8
Code:
cache-control: no-cache, must-revalidate, max-age=0
cf-h2-pushed: </min/09942.css>,</min/1ed0b.js>,</min/a44be.js>,</min/css_async.js>
cf-ray: 4200a642599b6127-BCN
content-encoding: br
content-type: text/html; charset=UTF-8
date: Thu, 24 May 2018 15:03:32 GMT
expect-ct: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
expires: Wed, 11 Jan 1984 05:00:00 GMT
server: cloudflare
status: 200
vary: Accept-Encoding
x-litespeed-cache-control: private,max-age=1800
x-litespeed-tag: 7b01_tag_priv,public:7b01_URL.6666cd76f96956469e7be39d750cc7d9,public:7b01_F,public:7b01_Po.821,public:7b01_PGS,public:7b01_
x-powered-by: PHP/7.2.5
x-turbo-charged-by: LiteSpeed
I have a similar issue, litespeed cache isn't working in any of the accounts and always missing the cache hit or miss header
Report: ZZVBLTXY
And Cache Root Setup seems Ok
Code:
Server level    /home/lscache/    /home/lscache/
VHost level    lscache*    lscache*
And I think I have the correct permissions on the account nobody:user
Any ideas?
 

Tishu

Well-Known Member
#11
Code:
cache-control: no-cache, must-revalidate, max-age=0
cf-h2-pushed: </min/09942.css>,</min/1ed0b.js>,</min/a44be.js>,</min/css_async.js>
cf-ray: 4200a642599b6127-BCN
content-encoding: br
content-type: text/html; charset=UTF-8
date: Thu, 24 May 2018 15:03:32 GMT
expect-ct: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
expires: Wed, 11 Jan 1984 05:00:00 GMT
server: cloudflare
status: 200
vary: Accept-Encoding
x-litespeed-cache-control: private,max-age=1800
x-litespeed-tag: 7b01_tag_priv,public:7b01_URL.6666cd76f96956469e7be39d750cc7d9,public:7b01_F,public:7b01_Po.821,public:7b01_PGS,public:7b01_
x-powered-by: PHP/7.2.5
x-turbo-charged-by: LiteSpeed
I have a similar issue, litespeed cache isn't working in any of the accounts and always missing the cache hit or miss header
Report: ZZVBLTXY
And Cache Root Setup seems Ok
Code:
Server level    /home/lscache/    /home/lscache/
VHost level    lscache*    lscache*
And I think I have the correct permissions on the account nobody:user
Any ideas?
You can check cache setup from this wiki https://www.litespeedtech.com/suppo..._wiki:cache:common_installation:cpanel-shared
 
#12
I checked the root cache setup and It says it's ok, but also
Code:
 # bash <(curl https://www.litespeedtech.com/packages/lscache/set_cache_root_policy.sh)
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  7956  100  7956    0     0  14930      0 --:--:-- --:--:-- --:--:-- 14954
Detect cPanel WHM environment

Found server level cache root has already been set to: /home/lscache/
List server root level cache root configuration files:
/etc/apache2/conf.d/includes/pre_main_global.conf:CacheRoot /home/lscache/

Found virtual host level cache root set to: /home/username/lscache
List virtual host level cache root configuration files:
/etc/apache2/conf.d/userdata/lscache_vhosts.conf:CacheRoot lscache
[Thu May 24 16:16:41.706807 2018] [cpanel:warn] [pid 2642317] Failed to populate suspended users. Could not open directory: /var/cpanel/suspended
Built /etc/apache2/conf/httpd.conf OK

Backup /usr/local/lsws/conf/httpd_config.xml to  /usr/local/lsws/conf/httpd_config.xml.bak_lscache
Check and remove any server level cache root and policy setting in LSWS config.
Redirecting to /bin/systemctl restart lsws.service
All the lscache folders of every account are nobody:(the user of the account) but no `x-litespeed-cache` hit or miss
 
#13
Another report for another account for If it helps to track the issue

Número de informe: RXZTNYKP

Fecha de informe: 05/25/2018 11:37:26

Another thing that may be a clue or not:
the lscache folder is nobody:user but all the subfolders and files are user:user except .cm.log that is nobody:user
Is that correct?
 

Jon K

Administrator
Staff member
#14
On one of the accounts having issues, can you try removing: /home/$USERNAME/lscache
Then do a graceful restart and see if cache starts to begin working?
 
#15
Done for one account and lscache "x-litespeed-cache" shows miss or hit :)
But the problem is that no lscache folder is created in that account :/
Is using the home/lscache folder?
 

Jon K

Administrator
Staff member
#19
Is it possible for you to open a ticket with us? We might need access to the server to figure out what is going on. Something seems very odd.
 
#20
Not I can't by myself (Your customer is iozoom hosting provider and i have a vps with them with cpanel + cloudlinux + lsws + lscache) but iozoom opened a ticket for me a while ago :)
Thats your respone:
Could you try test one of the account by delete the /home/USER/lscache and restart lsws to regenerate the lscache folder see if cache work again.
If so,
Try regenerate all lscache folder again by following command. Before regenerate, please test the command.

find /home/ -type d -maxdepth 2 -name lscache -print
find /home/ -type d -maxdepth 2 -name lscache -exec rm -R "{}" \;
service lsws restart

If still not working, we may need to check by accessing the server.
I have deleted all the lscache folders and this script:
Code:
bash <(curl https://www.litespeedtech.com/packages/lscache/set_cache_root_policy.sh)
"x-litespeed-cache" hit or miss in header for all accounts now but lscache folder in any account
If you need to access the server I can send you the credentials :)
 
Top