It is rather simple to have LSWS Cache and Magento work together. LSWS enable private cache and define URL pattern not to be cached.
Here are the steps that will enable LSWS to work with Mangento:
In LiteSpeed (v4.1.2 or later) Admin CP → Configuration → Server → Cache
Storage Path: /diskcache
Max Object Size: 128K
Cache Policy
Enable Cache: No
Cache Expire Time (seconds): Not Set
Cache Request with Query String: No
Cache Request with Cookie: No
Cache Response with Cookie: No
Ignore Request Cache-Control: No
Ignore Response Cache-Control: No
Enable Private Cache: Yes
Private Cache Expire Time (seconds): 60
Do-Not-Cache URL(s):
/checkout/
/admin
/customer
/downloader
Note:
Do-Not-Cache
URL box holds all of the
URL(s) that should
NOT be cached.
Cache storage can be set to /dev/shm/diskcache to avoid disk I/O wait if enough memory can be spared.
Cache resource with size less than 128KB.
For cached request, “X-LiteSpeed-Cache: private,hit” response header should be seen.
IOW, if no such entry in the response header, the response is not cached by LSWS.
*/10 * * * * find /diskcache -type f -mmin +10 –delete
Note: This cron job clean up stale cache storage every 10 minutes.
echo "mkdir /diskcache && chmod nobody.lsadm" >> /etc/rc.local
echo "/diskcache && chmod 770 /diskcache" >> /etc/rc.local
Note: this is to make sure cache directory gets created when server is booted up.