|
|

02-10-2013, 02:08 AM
|
|
Senior Member
|
|
Join Date: Jan 2013
Posts: 95
|
|
Private cache max-age ?
Hello,
Your wiki says to use E=Cache-Control:max-age=60 for 60 seconds public cache and E=Cache-Control:private for private cache.
Both of these work with .htaccess and mod_rewrite rules
Can I set the max-age for private cache in htacess files ?
Or can users only use the server global defined private cache max-age value ?
Thanks
|

02-12-2013, 12:15 AM
|
|
LiteSpeed Staff
|
|
Join Date: Sep 2009
Posts: 2,218
|
|
Quote:
|
Can I set the max-age for private cache in htacess files ?
|
yes. just tested and confirm it works.
|

02-12-2013, 12:25 AM
|
|
Senior Member
|
|
Join Date: Jan 2013
Posts: 95
|
|
|
Thanks,
How would I do this ? All my tries failed…
|

02-12-2013, 12:29 AM
|
|
LiteSpeed Staff
|
|
Join Date: Sep 2009
Posts: 2,218
|
|
for example, in .htaccess,
Code:
RewriteRule \.php - [E=Cache-Control:private,E=Cache-Control:max-age=300]
or
Code:
RewriteRule \.php - [E=Cache-Control:private]
RewriteRule \.php - [E=Cache-Control:max-age=300]
|

02-12-2013, 01:03 AM
|
|
Senior Member
|
|
Join Date: Jan 2013
Posts: 95
|
|
|
Thanks,
I was under the impression that those lines would first set the envrionement variable to private and then replace the private setting by max-age=300 thus being the equivalent of only max-age=300…
With Apache's mod_cache, Cache-Control should be set to :
"max-age=300, private"
|

02-12-2013, 01:32 AM
|
|
Senior Member
|
|
Join Date: Jan 2013
Posts: 95
|
|
I've just tested :
RewriteRule \.php - [E=Cache-Control rivate,E=Cache-Control:max-age=300]
Code:
X-LiteSpeed-Cache : hit
RewriteRule \.php - [E=Cache-Control rivate]
Code:
X-LiteSpeed-Cache : hit,private
|

02-12-2013, 02:22 AM
|
|
LiteSpeed Staff
|
|
Join Date: Sep 2009
Posts: 2,218
|
|
hmm ... I'd like to reproduce your result, to find out possible bugs.
what's the cache policy you set ? and any other rewrite rules ?
I did tests only for this simple php:
PHP Code:
/usr/local/lsws/DEFAULT/html>cat r.php
<?php
echo date("c");
echo "\n";
?>
|

02-12-2013, 02:42 AM
|
|
Senior Member
|
|
Join Date: Jan 2013
Posts: 95
|
|
Hello,
My .htaccess file :
Code:
RewriteEngine On
RewriteRule \.php - [E=Cache-Control:private,E=Cache-Control:max-age=300]
#end of file
I used your r.php script
Cache-Crontrol is an environement variable, if you set it twice it's normal that the second value replaces the first.
You need to be able to set both values seperated by a comma. However I havn't found the correct syntax to do this :
I've tried without success things like this :
Code:
RewriteRule \.php - [E=Cache-Control:'private, max-age=180']
But it gives an error in ls logs:
Code:
ERROR [[HTAccess]] rewrite: Unknown rewrite rule flag while parsing: RewriteRule \.php - [E=Cache-Control:'private, max-age=180']
My cache is set to :
Code:
Enable Cache : Not Set
Cache Expire Time (seconds) : Not Set
Cache Request with Query String : Yes
Cache Request with Cookie : No
Cache Response with Cookie : No
Ignore Request Cache-Control : No
Ignore Response Cache-Contro : No
Enable Private Cache : Not Set
Private Cache Expire Time (seconds) : 60
Thanks
|

02-12-2013, 03:00 AM
|
|
LiteSpeed Staff
|
|
Join Date: Sep 2009
Posts: 2,218
|
|
my test result always:
Code:
X-LiteSpeed-Cache: hit,private
here's one of result:
Code:
~>curl -i 127.0.0.1/r.php
HTTP/1.1 200 OK
Date: Tue, 12 Feb 2013 10:55:17 GMT
Server: LiteSpeed/4.2.2 Enterprise
Connection: Keep-Alive
Keep-Alive: timeout=5, max=100
X-LiteSpeed-Cache: hit,private
Content-Length: 26
X-Powered-By: PHP/5.3.10
Content-Type: text/html
2013-02-12T18:55:14+08:00
I'm testing with lsws 4.2.2
|

02-12-2013, 03:09 AM
|
|
Senior Member
|
|
Join Date: Jan 2013
Posts: 95
|
|
Quote:
~ curl -i http://test.tld/r.php
HTTP/1.1 200 OK
Date: Tue, 12 Feb 2013 11:03:35 GMT
Server: LiteSpeed
X-LiteSpeed-Cache: hit
Content-Length: 26
Content-Type: text/html; charset=UTF-8
Connection: close
2013-02-12T12:03:34+01:00
|
I haven't upgraded to LiteSpeed/4.2.2 Enterprise yet (I'm running 4.2.1).
Is 4.2.2 in Release ?
In my WHM interface it says :
Latest Release: 4.2.1
I prefer to wait untill version 4.2.2 shows as an available update in the WHM interface unless the update feature doesn't work and will never show the next version ?
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -7. The time now is 12:57 PM.
|
|