Good news Litespeed 4.0.19 fixed the cache settings issue, now test.php gets cached while testnocache.php doesn't get cached with cache policy in 4.0.19 set as per below settings.
test.php header
Code:
view source
Content-Encoding gzip
Vary Accept-Encoding
Date Fri, 21 Jan 2011 20:54:52 GMT
Server LiteSpeed
Connection Keep-Alive
Keep-Alive timeout=5, max=100
X-LiteSpeed-Cache hit
Content-Length 79
X-Powered-By PHP/5.3.5
CurrentTime Fri, 21 Jan 2011 20:54:34 GMT
Content-Type text/html; charset=UTF-8
testnocache.php header
Code:
Content-Encoding gzip
Vary Accept-Encoding
Date Fri, 21 Jan 2011 20:54:59 GMT
Server LiteSpeed
Connection Keep-Alive
Keep-Alive timeout=5, max=100
X-Powered-By PHP/5.3.5
CurrentTime Fri, 21 Jan 2011 20:54:59 GMT
Content-Type text/html; charset=UTF-8
Content-Length 79
test.php
Code:
ab -k -n 1000 -c 200 192.168.56.101/test.php
This is ApacheBench, Version 2.0.40-dev <$Revision: 1.146 $> apache-2.0
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Copyright 2006 The Apache Software Foundation, http://www.apache.org/
Benchmarking 192.168.56.101 (be patient)
Completed 100 requests
Completed 200 requests
Completed 300 requests
Completed 400 requests
Completed 500 requests
Completed 600 requests
Completed 700 requests
Completed 800 requests
Completed 900 requests
Finished 1000 requests
Server Software: LiteSpeed
Server Hostname: 192.168.56.101
Server Port: 80
Document Path: /test.php
Document Length: 63 bytes
Concurrency Level: 200
Time taken for tests: 0.42640 seconds
Complete requests: 1000
Failed requests: 0
Write errors: 0
Keep-Alive requests: 1000
Total transferred: 346952 bytes
HTML transferred: 63000 bytes
Requests per second: 23452.16 [#/sec] (mean)
Time per request: 8.528 [ms] (mean)
Time per request: 0.043 [ms] (mean, across all concurrent requests)
Transfer rate: 7926.83 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 1.6 0 6
Processing: 0 2 1.0 3 5
Waiting: 0 2 1.0 3 5
Total: 0 3 1.5 3 11
Percentage of the requests served within a certain time (ms)
50% 3
66% 3
75% 3
80% 3
90% 6
95% 7
98% 8
99% 8
100% 11 (longest request)
testnocache.php
Code:
ab -k -n 1000 -c 200 192.168.56.101/testnocache.php
This is ApacheBench, Version 2.0.40-dev <$Revision: 1.146 $> apache-2.0
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Copyright 2006 The Apache Software Foundation, http://www.apache.org/
Benchmarking 192.168.56.101 (be patient)
Completed 100 requests
Completed 200 requests
Completed 300 requests
Completed 400 requests
Completed 500 requests
Completed 600 requests
Completed 700 requests
Completed 800 requests
Completed 900 requests
Finished 1000 requests
Server Software: LiteSpeed
Server Hostname: 192.168.56.101
Server Port: 80
Document Path: /testnocache.php
Document Length: 63 bytes
Concurrency Level: 200
Time taken for tests: 0.184258 seconds
Complete requests: 1000
Failed requests: 0
Write errors: 0
Keep-Alive requests: 1000
Total transferred: 323000 bytes
HTML transferred: 63000 bytes
Requests per second: 5427.17 [#/sec] (mean)
Time per request: 36.852 [ms] (mean)
Time per request: 0.184 [ms] (mean, across all concurrent requests)
Transfer rate: 1709.56 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 1.5 0 6
Processing: 20 28 14.6 21 89
Waiting: 20 28 14.4 21 88
Total: 20 29 15.7 21 89
Percentage of the requests served within a certain time (ms)
50% 21
66% 26
75% 27
80% 28
90% 59
95% 67
98% 72
99% 83
100% 89 (longest request)
The test.php and testnocache.php file used contains
Code:
<?php
header('CurrentTime: '.gmdate('D, d M Y H:i:s', time()).' GMT',true);
echo "time()=" . time() . "<br>";
echo "date()=" . date(DATE_RFC822) ."<br>";
?>
Apache httpd.conf contains
Code:
#disk cache
<IfModule mod_cache.c>
<IfModule mod_disk_cache.c>
CacheRoot /lscache/
#CacheEnable disk /
</IfModule>
</IfModule>
Litespeed 4.0.18 cache policy is set to
Code:
Enable Cache:No
Cache Request with Query String:Yes
Cache Request with Cookie:Yes
Cache Response with Cookie:Yes
Ignore Request Cache-Control:Yes
Ignore Response Cache-Control:Yes