Fix Bad Cache Storage Configuration
LiteSpeed Web Server, as of v5.3, has an improved cache engine that can fix badly-configured cache storage directories and file permissions.
Normally in a control panel environment, server-level and virtual-host-level cache roots are set in the Apache configuration, or in include files. Once these are set and LSWS is restarted, the web server will create the required directories automatically, and with correct ownership and permissions.
However, a user may have manually created a cache folder with the wrong ownership or permissions. This will cause a lot of problems later when creating cache entries of looking them up. LSWS 5.3+ addresses this problem by automatically fixing such cache root issues.
Example: Cache Directory and File Permissions
For example, on cPanel, usually a virtual-host-level cache root is normally set to /home/$USER/lscache
with nobody:user
ownership.
If, somehow, a user has manually created /home/$USER/lscache
with user:user
ownership, when LSWS restarts, the server will automatically detect the error and change the cache diretory to be owned by “nobody:user”.
Example: Create Directory
Previously, when Just In Time Configuration was enabled on the LSWS server configuration, a virtual host cache folder could not be created. The way to fix it was to disable JIT in virtual host configuration.
Now, LSWS 5.3 and later can handle such a situation. Even when “Just In Time Configuration” is enabled, after the first request hits the vhost, lscache
will be created. For this case, cache won't be used for the first request and there will be a little delay for vhost to enable cache. This is by design.