This is an old revision of the document!


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.

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.

Under “Cache Policy” at either the Server or Virtual Host level, set the following:

Enable Public Cache - No
Check Public Cache - Yes
Ignore Request Cache-Control - Yes
Ignore Response Cache-Control - Yes

All other settings can be left as Not Set.

Perform a graceful restart of LiteSpeed Web Server.

Note: Shared hosting providers can selectively enable LSCache by setting Check Public Cache to “Not Set”(but never be “No” otherwise it will turn off the cache lookup and LScache won't work) at the server level (Configuration»Server»Cache»Cache Policy) and then adding the following directive to the .htaccess file of a specific WordPress installation.

<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.

For Advanced Cache Configuration info, look here.

  • Admin
  • Last modified: 2016/09/29 20:26
  • by Jackson Zhang