I'm trying to implement cookie based conditional page caching for a rails project. Very similar to this site:
http://www.ethelred.org/articles/2006/10/22/conditional-use-of-page-cache-in-rails
Basically non-logged in users get a cached site and logged in users get dynamic content. I have 90% of it working but there seems to be a small problem with the HTTP_COOKIE condition in the rewrite. When a user logs out they still see cached content unless they click the refresh button manually within there browser for each page, or wait about 30 seconds. Any ideas? Here is a copy of my Litespeed vhost rewrite rule.
RewriteCond %{HTTP_COOKIE} !^.*logged_in=yes.*$
RewriteRule ^(.*)/$ $1/index.html [QSA]
RewriteCond %{HTTP_COOKIE} !^.*logged_in=yes.*$
RewriteRule ^([^.]+)$ $1.html [QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ /dispatch.lsapi [QSA,L]
Thanks,
Dan
http://www.ethelred.org/articles/2006/10/22/conditional-use-of-page-cache-in-rails
Basically non-logged in users get a cached site and logged in users get dynamic content. I have 90% of it working but there seems to be a small problem with the HTTP_COOKIE condition in the rewrite. When a user logs out they still see cached content unless they click the refresh button manually within there browser for each page, or wait about 30 seconds. Any ideas? Here is a copy of my Litespeed vhost rewrite rule.
RewriteCond %{HTTP_COOKIE} !^.*logged_in=yes.*$
RewriteRule ^(.*)/$ $1/index.html [QSA]
RewriteCond %{HTTP_COOKIE} !^.*logged_in=yes.*$
RewriteRule ^([^.]+)$ $1.html [QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ /dispatch.lsapi [QSA,L]
Thanks,
Dan