Posted by heyyo on January 11, 2011 at 9:53am
2 followers
| Project: | Translation 404 - Translation Page Not Found |
| Version: | 6.x-1.2 |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | needs review |
Issue Summary
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
Comments
#1
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:
<?phpglobal $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:
<?phpif ($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.