Exclude logged in users without wordpress plugin

mgd

New Member
#1
On a site without wordpress but active LSCache module I want to exclude logged in users (custom login script) like this can be done in the wordpess plugin for LSCache.

Are there any rewrite rules or configuration settings I don't know yet?

What I have tried so far are the following rewrite rules where the login_user cookie identifies logged in users:

Code:
RewriteCond %{HTTP_COOKIE} login_user
RewriteRule .*  - [E=Cache-Control:private]

RewriteCond %{HTTP_COOKIE} !login_user
RewriteRule .*  - [E=Cache-Control:max-age=300 ]
If the logged in user hits a page first, no cache headers appear (is there anything wrong with my private caching rule?). But if an anonymous visitor requests the page, a cache entry will be served for logged in users too.
 

mgd

New Member
#4
After some testing I found out that this rewrite rule will not enable private caching (even withhout any conditions) :
Code:
RewriteRule .*  - [E=Cache-Control:private]
I did not change anything in the server configuration cache module and public cache with following rule enables public cache without further configuration:
Code:
RewriteRule .* - [E=Cache-Control:max-age=300]
Is there anything that I did miss in order to enable private cache?
 
Top