Web Cache Web Server Configuration - LiteSpeed Native

Note: If you are running your server with cPanel/WHM or Plesk, you should not follow the instructions on this page.

Cache Storage Settings

Set Server level cache root

From the WebAdmin Console, navigate to Configuration » Server » Cache and set Storage Path under “Cache Storage Settings”.

For example:
Storage Path: /home/lscache/.

Set virtual host level cache root

From the WebAdmin Console, navigate to Configuration » Virtual Hosts » <vh_name> » Cache and set Storage Path under “Cache Storage Settings”.

For example:
Storage Path: /home/<vh_user>/lscache/.

If it does not exist, the cache directory will be created automatically by LiteSpeed Web Server during startup as lscache under the user's home directory.

Notes: If different vhosts share the same document root, these vhosts have to share the same vhost level cache root directory.

Cache Policy Settings

Under “Cache Policy” at either the Server or Virtual Host level, leave all cache policies as “not set”.

Add the following Apache style configuration directive to .htaccess file of a specific WordPress installation to enable cache lookup.

<IfModule LiteSpeed>
  CacheLookup public on
</IfModule>

This will have the effect of turning on LSCache for only this site, allowing you to choose which sites have caching enabled.

Note:

  • “Enable Public Cache” should always be “Not Set” or “No” unless you want to enable cache globally, which is definitely not recommended.
  • Check Public Cache better set to “Not Set” but should never be “No” otherwise it will turn off the cache lookup and LScache won't work.

Enable .htaccess Use

This can be configured in both the server level and the vhost level but is more commonly done at the server level.

In your LiteSpeed Web Server Web Admin, navigate to Configuration > Server > General and scroll to about halfway down the page. You should see an HT Access section.

You should select the checkboxes to match the screenshot above.

Note: if you're enabling this at the vhost level, the same settings should be listed in the LiteSpeed Web Server Web Admin under the Configuration > Virtual Hosts > <Your VHost> > General and the same checkboxes should be checked.

Restart LSWS

Please perform a graceful restart of LiteSpeed Web Server after any configuration change to the server.

Advanced Cache Configuration

For Advanced Cache Configuration info, look here.

 
litespeed_wiki/cache/common_installation/litespeed-shared.txt · Last modified: 2016/09/30 15:05 by Rob Holda