I know that you are not obligated to support Pressflow but let me ask if you can help to make this module works with Pressflow.
When using Pressflow, it is recommend to get a better caching system, to not use at all session for anonymous.
https://wiki.fourkitchens.com/pages/viewpage.action?pageId=13828781

CommentFileSizeAuthor
#1 translation404.module.SESSION_FIX.diff1.61 KBbibo

Comments

bibo’s picture

Title: Remove anonymous session or make it optional for pressflow compatiblity » Remove anonymous sessions or make them optional (performance boost!)
Status: Active » Needs review
StatusFileSize
new1.61 KB

I changed the title a bit. This isn't really about pressflow compatibility, since Pressflow can be used normally whether this module is enabled or not. However, pressflow allows unauthenticated users to not have sessions autogenerated (but only if they are needed).

The current behaviour of this module can be a serious performance killer, since it generates sessions for any traffic, including search crawlers etc. At worst, each pageload could generate a new crawler session (since the crawlers don't necessarily include cookies in their requests). This could mean that there are 70 000 sessions in the sessions table, even though only about 500 of them are actually used or make sense. I witnessed this on a well-sized site that had become really slow.

This SESSION-usage isn't really even needed. Luckily it's pretty easy to make this use sessions only for authenticated users, and avoid potentially over 90% of useless sessions.

Here is a simple patch attached, only a few lines changed + some comments. The most important lines are these:

  global $user;
  // Make sure session is only invoked for logged in users (works in Pressflow)! Otherwise anonymous users 
  // and search crawlers may bloat your sessions-table, making it many times larger than it needs to be.
  // --> Only use session for logged in users.
  if ($user->uid && $info['stored']) {
    $_SESSION['translation404_stored'] = $info['stored'];
    ...

Instead of:

  if ($info['stored']) {
     $_SESSION['translation404_stored'] = $info['stored'];
    ...

PS: Since this module doesn't look very well maintained, I doubt It'll make it to the official release. So, probably you need to patch this manually.