Varnish + Joomla

kevin k at kevinkevin.com
Tue Jun 28 03:42:46 CEST 2011


I have been attempting to do the following (with no luck so far), since
(from what I understand) the logged in session cookie is a long random hash
name :

[varnish 3.0]


vcl_recv :

set req.http.Cookie = regsuball(req.http.Cookie,
"(^|;\s*)(_[_a-z]+|has_js|base_domain|fbsetting|PHPSESSID)=[^;]*", "");

if ( !(regsuball(req.http.Cookie,
"(^|;\s*)(_[_a-z]+|has_js|base_domain|fbsetting|simpleCart)=[^;]*", ""))){
set req.backend = iamloggedin;
return(pass);
}


vcl_hash :

if ( !(regsuball(req.http.Cookie,
"(^|;\s*)(_[_a-z]+|has_js|base_domain|fbsetting|simpleCart|PHPSESSID)=[^;]*"
, ""))){
hash_data(req.http.Cookie);
}


I know I'm missing something so any way you can assist would be greatly
appreciated. I don't consider myself a varnish expert by any means so I'm
positive there is a way to do this safely. My tests over the course of the
past month have produce mixed results, such as caching the login message of
another user (oops).


Thanks!

~kevin


> Joomla had some issues with varnish until we started running mod_rpaf with
apache. They rely on the IP address REMOTE_ADDR for quite a bit of their
internal stuff. Then, some of the themes (rockettheme > for one) rely on it.
We worked with it for quite a bit but I was never too happy with it.
>
> You can write VCL to determine if they are not logged in and remove that
cookie to get it to cache. I'll have to look through my notes.

On Jun 27, 2011, at 6:15 PM, kevin wrote:

>> I was curious if anyone out there has used varnish and joomla together
>> (successfully). I would love to see a working configuration of varnish
2.1
>> (or even 3.0) with Joomla. I am particularly interested in how to deal
with
>> the PHPSESSID session cookie that is created (by joomla) for every single
>> visitor, logged in or not. 






More information about the varnish-misc mailing list