Newbie trying to configure OpenLiteSpeed as Reverse Proxy. Any help appreciated!

lsqtwrk

Administrator
#21
did you enable cache in OLS ?

and please create a new sub-dir wordpress , and only installs WP + LSCWP + the 2 lines in .htaccess

then check in that sub-dir WP and see if caching works ?
 
#22
Cache was indeed disabled under WebAdmin OLS Server Configuration > Modules ('enableCache' and 'enablePrivateCache' were both set to 0). Below my (now assumed correct) cache module parameters:

checkPrivateCache 1
checkPublicCache 1
maxCacheObjSize 10000000
maxStaleAge 200
qsCache 1
reqCookieCache 1
respCookieCache 1
ignoreReqCacheCtrl 1
ignoreRespCacheCtrl 0

enableCache 1
expireInSeconds 3600
enablePrivateCache 1
privateExpireInSeconds 3600
storagePath $VH_ROOT/olscache

After purging all caches (W3 Total Cache, LiteSpeed Cache and Cloudflare) and visiting any page, I can indeed see the header x-litespeed-cache: hit on the first GET request on the page URL. But all of the subsequent requests to load static assets (.js, .css, image files) I see a x-litespeed-cache: miss header.

I don't think this is the expected behavior, even though static files are being served through Cloudflare.

On cache settings for LiteSpeed plugin, I simply enabled all cache options, without changing any values (so all default values for TTL apply). I've also disabled auto purge options, but I still get 'cache miss' on all static files.

Any ideas on what could be the issue, or what test I could do to try to solve this?
 

lsqtwrk

Administrator
#23
Hi,

1. cache on static resources is meaningless and pointless, and it was not even supposed to have cache header over them.

2. as the cache instruction was made by plugin , and it doesn't instruct OLS to cache static resources.

3. when static is cached by CF , then header won't change anymore.
 
#24
Ok, then I assume my LSCache is already working as expected (only first request get "hit" for x-litespeed-cache header). I will now start to play with the settings in order to find the optimal configuration for my site.

I have just one final question related to the definition of the storagePath for the cache files (cache module parameters from OLS WebAdmin server configuration): I assumed it would be good practice to define storagePath folder inside Wordpress installation cache folder, creating a subfolder for LiteSpeed (public_html/wp-content/cache/lscache). But it seems that this folder is then owned by user "nobody", which doesn't allow the "Wordpress site owner" to look into its contents.

So the discussion is: should i simply change ownership of folder/files inside lscache folder to the wordpress site owner (will OLS still work properly)? Or should I then let the "default" storagePath as /usr/local/lwsw/cachedata (where OLS is installed on server) and then don't bother about having the cached data "away" from Wordpress installation?
 

lsqtwrk

Administrator
#25
personally I would suggest to use default.

if you have multiple sites , better to use default , otherwise you will need to copy-paste to set up cache module on every single vhost you want to use cache.
 
Top