sorry i should have included what ive already tried.
i can get content to be cached, but max-age is still ignored.
lsws enterprise 2 cpu 4.2.23
Code:
Enable Cache No
Max Object Size 128K
Cache Expire Time (seconds) 60
Cache Stale Age (seconds) 5
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 No
Enable Private Cache No
Private Cache Expire Time (seconds) 0
/test/.htaccess
Code:
<IfModule LiteSpeed>
CacheEnable public /
</IfModule>
/test/test2.php:
PHP:
<?
header("Cache-Control: public, max-age=20");
header('Expires: '.gmdate('D, d M Y H:i:s',time()+20).' GMT');
print "test=".time();
?>
Code:
$ wget -O - -S http://localhost/test/test2.php 2>&1| grep -E 'Cache|test'
--2015-05-16 03:19:56-- http://localhost/test/test2.php
Cache-Control: public, max-age=20
test=1431710396
$ wget -O - -S http://localhost/test/test2.php 2>&1| grep -E 'Cache|test'
--2015-05-16 03:19:58-- http://localhost/test/test2.php
X-LiteSpeed-Cache: hit
Cache-Control: public, max-age=20
test=1431710396
$ wget -O - -S http://localhost/test/test2.php 2>&1| grep -E 'Cache|test'
--2015-05-16 03:20:19-- http://localhost/test/test2.php
X-LiteSpeed-Cache: hit
Cache-Control: public, max-age=20
test=1431710396
$ wget -O - -S http://localhost/test/test2.php 2>&1| grep -E 'Cache|test'
--2015-05-16 03:20:25-- http://localhost/test/test2.php
X-LiteSpeed-Cache: hit
Cache-Control: public, max-age=20
test=1431710396
$ wget -O - -S http://localhost/test/test2.php 2>&1| grep -E 'Cache|test'
--2015-05-16 03:20:32-- http://localhost/test/test2.php
X-LiteSpeed-Cache: hit
Cache-Control: public, max-age=20
test=1431710396
$ wget -O - -S http://localhost/test/test2.php 2>&1| grep -E 'Cache|test'
--2015-05-16 03:20:56-- http://localhost/test/test2.php
X-LiteSpeed-Cache: hit
Cache-Control: public, max-age=20
test=1431710396
$ wget -O - -S http://localhost/test/test2.php 2>&1| grep -E 'Cache|test'
--2015-05-16 03:20:59-- http://localhost/test/test2.php
Cache-Control: public, max-age=20
test=1431710459
$ wget -O - -S http://localhost/test/test2.php 2>&1| grep -E 'Cache|test'
--2015-05-16 03:21:03-- http://localhost/test/test2.php
X-LiteSpeed-Cache: hit
Cache-Control: public, max-age=20
test=1431710459
as you can see, it was cached for 60 seconds, not 20.
i tried setting Cache Expire Time (seconds)=not set, but its cached for a long time (86400 probably)
and Cache Expire Time (seconds)=0 means nothing is cached at all.
also seems that cannot strip headers (eg, set-cookie) for cacheable content, only exclude such content?
nor can i choose to cache 404's, 301's and 302's (wordpress 404's are very expensive, dos danger here!)
(i found that a rewrite rule can force caching of a 404 if i know the url beforehand, but couldnt think of any other way)
id really like to dump the extra varnish layer. but it seems like litespeed cache isn't flexible enough for me.
perhaps these are some features you might add later.