> On Tue, Jan 1, 2013 at 1:41 PM, Sean Coates <[email protected]> wrote:
> Habari's habit of `session_start()` on every request makes it a bit difficult 
> out of the box (Varnish won't cache requests that contain cookies by 
> default). Then again, almost every PHP application ever does this, so it's 
> not really a Habari problem.
> 
> Did you change the Varnish config, or find something Habari-side to improve 
> this? There's been discussion lately (and there's a ticket for it) to stop 
> creating a session for every user on every request, but we keep running into 
> problems with a lot of things (errors and notices, for instance).

I changed the varnish config, but I had to make a non-trivial whitelist of 
pages that allow cookies for things like comments (and admin). It certainly 
wasn't ideal.

Like I said, though, almost all PHP apps that use a session start one on every 
page within the app. It's pretty bad. /-:
We (for small values of "we") should probably finish up that session cleanup 
stuff, yeah. Fixing it in the app is the right way.
One other thing that I remember doing was to send a header on pages I knew 
didn't *need* to have cookies (like `X-drop-cookie: 1`), and then I could have 
Varnish drop cookies for those pages and in turn cache the contents.

FWIW, despite the mess, this performs significantly better than in-app caching 
(like the staticcache plugin).

S


-- 
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at http://groups.google.com/group/habari-dev

Reply via email to