
01-11-2011, 04:51 PM
|
|
LiteSpeed Staff
|
|
Join Date: Sep 2009
Posts: 2,216
|
|
rtight, it works in .htaccess, just like other rewrite rules.
currently, no special response header to indicate it's from cache.
however, it's easy to verify if it's from cache or not. for example,
PHP 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>";
?>
the output of this page changes for every visit if no cache.
with cache enabled, the page has no change until cache expire 10 minutes later.
the rewrite rule should be:
Code:
RewriteCond %{HTTP_COOKIE} !username=
RewriteRule /index.php - [E=Cache-Control:max-age=600]
|