OLS Cache Module/LScache does not work

#1
Hello!

I just installed OLS Web Server and LScache following the official openlitespeed.org guidelines, but the cache did not work for me. My stack is:

VPS -> CentOS 7 (Updated) -> OLS (1.4.41) -> MariaDB 10.1 -> PHP7.2 (lsphp72 lsphp72-common lsphp72-mysqlnd lsphp72-gd lsphp72-process lsphp72-mbstring lsphp72-xml lsphp72-mcrypt lsphp72-pdo lsphp72-imap lsphp72-soap lsphp72-bcmath lsphp72-intl lsphp72-json lsphp72-opcache) -> Wordpress 5.0.2. I use the GeneratePress theme and I have the LiteSpeed Cache 2.9 plug-in installed.


I have correctly configured the external app and script handler to have php 7.2. I have also configured the virtual host and listerner well. Wordpress works correctly.
But for some reason that I do not know, the cache is not working. In the response headers there is 'X-LiteSpeed-Cache-Control: public, max-age: 604800' and 'X-LiteSpeed-Tag: 2271_PGSRP, 2271_home, 2271_URL.6666cd76f96956469e7be39d750cc7d9,2271_F, 2271_'. But does not appear 'X-LiteSpeed-Cache: miss / hit'.

'Cache-control: no-cache' and 'Pragma: no-cache' appear in the request headers.

'Cache.so' appear in /lsws/modules/ and in /lsws/cachedata/ appear '0'. In server configuration -> modules -> I have configured the cache module with these parameters
----------------------------------
enableCache 0
qsCache 1
reqCookieCache 1
respCookieCache 1
ignoreReqCacheCtrl 1
ignoreRespCacheCtrl 0
enablePrivateCache 0
privateExpireInSeconds 1000
expireInSeconds 1000
storagePath cachedata
checkPrivateCache 1
checkPublicCache 1
----------------------------------

In virtual host -> rewrite > i have configured these parameters:
----------------------------------
Enable Rewrite: Yes
Auto Load from .htaccess: No
Rewrite Rules: rewriteFile /usr/local/lsws/TyV/html/.htaccess
----------------------------------

The cache is enabled in the plug-in LSCache 2.9, and in wp-config-php it is set define('WP_CACHE', 'true').

The .htaccess file contains:
--------------------------------------------------------------------------------------------
# BEGIN LSCACHE
## LITESPEED WP CACHE PLUGIN - Do not edit the contents of this block! ##
<IfModule LiteSpeed>
RewriteEngine on
CacheLookup on
RewriteRule .* - [E=Cache-Control:no-autoflush]
RewriteRule ^min/\w+\.(css|js) - [E=cache-control:no-vary]

### marker CACHE RESOURCE start ###
RewriteRule wp-content/.*/[^/]*(responsive|css|js|dynamic|loader|fonts)\.php - [E=cache-control:max-age=3600]
### marker CACHE RESOURCE end ###

### marker LOGIN COOKIE start ###
RewriteRule .? - [E="Cache-Vary:wp-postpass_f6ca0217b63d378f392aa75ac5d443e5"]
### marker LOGIN COOKIE end ###

### marker FAVICON start ###
RewriteRule favicon\.ico$ - [E=cache-control:max-age=86400]
### marker FAVICON end ###

</IfModule>
## LITESPEED WP CACHE PLUGIN - Do not edit the contents of this block! ##
# END LSCACHE
# BEGIN NON_LSCACHE
## LITESPEED WP CACHE PLUGIN - Do not edit the contents of this block! ##
### marker MINIFY start ###
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} ^(.*)/min/(\w+)\.(css|js)$
RewriteCond %1/wp-content/cache/$2/$1.$2 -f
RewriteRule min/(\w+)\.(css|js) wp-content/cache/$2/$1.$2 [L]
</IfModule>
### marker MINIFY end ###

## LITESPEED WP CACHE PLUGIN - Do not edit the contents of this block! ##
# END NON_LSCACHE

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress
--------------------------------------------------------------------------------------------

I have been testing different configurations and I have given permission 777 the entire folder /lsws/ and their children, but the cache does not work. Could someone help me please? If you need any more information or file, ask me

 

Pong

Administrator
#4
storagePath cachedata

is the directive to setup cache root.

Is the folder /usr/local/lsws/cachedata writable by web server(normally nobody by default if you don't make anychange to it)?
 
#5
This is the information that the command "ls -a -l" gives me about the cachedata folder:

drwxrwxrwx 3 nobody nobody 4096 Jan 2 15:30 cachedata

I understand that the folder is writable. Do you think this has a solution?

Thanks!
 

Pong

Administrator
#6
Can you remove all cache files and give another try? What's the URL for testing?

cd /usr/local/lsws/cachedata/
rm -rf *
 

Pong

Administrator
#8
Can you log a ticket with us by providing tmp root ssh access to your server and wordpress admin login for us to take a look?
 
#9
Can you log a ticket with us by providing tmp root ssh access to your server and wordpress admin login for us to take a look?
No problem Pong. How can I log a ticket to send you the root access server and wordpress administrator user?
Do you need something else? Any report or log?

Please, I would like you to inform me before entering the server, and if you find a solution, could you explain to me in detail what is the problem? To know how to solve it when installing OLS in other VPS.

Thanks!
 
#10
No problem Pong. How can I log a ticket to send you the root access server and wordpress administrator user?
Do you need something else? Any report or log?

Please, I would like you to inform me before entering the server, and if you find a solution, could you explain to me in detail what is the problem? To know how to solve it when installing OLS in other VPS.

Thanks!
Hi Rafael,

You can create a ticket here - https://store.litespeedtech.com/store/submitticket.php?step=2&deptid=2
 
#11
Hello again,

I just registered a ticket #771297 (subject: OLS Cache Module/LScache does not work) with the information you asked for.

Please, let me know when you are going to enter the VPS.

If you find a solution to the problem, explain in detail how to solve it.

Thank you very much, I hope answers soon.
 
#13
sure. we will work on the ticket then and update back here for any more findings.
Okay, Pong. Thank you! More or less when you start working on my case?

I have a couple of other questions:

1. Do you recommend installing CyberPanel?
2. When passing some performance tests as GTmetrix, it shows me that the GZIP is not activated, but in the control panel of OLS (port 7080) I see that the option is activated. Is it a bug?
 

lsqtwrk

Administrator
#14
hI,

1. Yes, it would make it easier to use.

2. I see your website is behind Cloudflare and showing "br" compression, do you not see gzip or br header?

Best regards,
 
#15
Hi!

Perfect, i'll install Cyberpanel then.

Right now the web that is online is served by another server that is not OLS, and is powered by Cloudflare. I have done this because I have sent a ticket with the access data of the VPS where I have installed OLS so that they check because the cache does not work.

Therefore in the headers appears gzip or br compression. But yesterday when the web was hosted on the VPS with OLS, GTmetrix told me to activate gzip to improve the performance of the web.

Thanks! Best regards.
 

Pong

Administrator
#16
Regarding the initial problem "OLS Cache Module/LScache does not work", we have got the login and fixed the issue. Now just want to share back the result.

In Cache module, there is "Enable Hooks" option, It means "Enable Module", somehow it has been set to "No", which literally turn off Cache Module. Reset it to "Yes" and solved the problem.

We will change the description to "Enable Module" for a future release.
 

Pong

Administrator
#17
Better keep one thread to one issue only and feel free to create a new thread if there is any other question.

The original cache enabling issue has been resolved and I guess this thread can be closed.
 
#18
Effectively, the initial problem has been solved.

I think it's a good idea to change the name to "enable module" :)

I'm sorry, I'll open a new thread.

Yes, the thread can be closed.

Thank you very much everyone for the help. Great team.

Best regards
 
Top