Return-Path: Delivered-To: apmail-perl-modperl-archive@www.apache.org Received: (qmail 41651 invoked from network); 27 Jan 2010 22:46:29 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 27 Jan 2010 22:46:29 -0000 Received: (qmail 4384 invoked by uid 500); 27 Jan 2010 22:46:27 -0000 Delivered-To: apmail-perl-modperl-archive@perl.apache.org Received: (qmail 4319 invoked by uid 500); 27 Jan 2010 22:46:27 -0000 Mailing-List: contact modperl-help@perl.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list modperl@perl.apache.org Received: (qmail 4311 invoked by uid 99); 27 Jan 2010 22:46:27 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 27 Jan 2010 22:46:27 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of pharkins@gmail.com designates 209.85.221.177 as permitted sender) Received: from [209.85.221.177] (HELO mail-qy0-f177.google.com) (209.85.221.177) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 27 Jan 2010 22:46:20 +0000 Received: by qyk7 with SMTP id 7so30683qyk.10 for ; Wed, 27 Jan 2010 14:45:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type; bh=sGsRPFnZPSUhY3bMLaPmIX407eNgBk4c7zkQMGEPHpk=; b=Z8GGOAuk3m2lwYeEd5gjM2qFdAUFtv9j4zeL0X/Yjb/zxSYIzrkH5XBMM6l6X1d9Me B/p+zxDDKWWALtNvBVjKzZhTU15yh/mhScx5qg3kgJlswpbeXI999UKGh1X5A5Q5EUj7 CQIkR420/E/U44bkyTVk8y1ODMrdBcm9FXUP4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=vsWsg6+w5kwi0MHYEJCWqRk4Uuf5OiizzzsKksSyquRuEnomg4RlX5lQp5iLM1xRkJ j43DkbAo9Xcz7CunUh5XKpR8CKawdNZ6rULuac6dG5vcQAcyjfFXlRXdqcqeUleTfqzq WomUMDZL5ueT0WJJ9jDYb+9A2uksV3oFcnGWs= MIME-Version: 1.0 Received: by 10.229.59.203 with SMTP id m11mr5337661qch.94.1264632359789; Wed, 27 Jan 2010 14:45:59 -0800 (PST) In-Reply-To: <6E362660-4E52-4CA2-83C0-9379960C5EF2@POBOX.COM> References: <6E362660-4E52-4CA2-83C0-9379960C5EF2@POBOX.COM> Date: Wed, 27 Jan 2010 17:45:59 -0500 Message-ID: <66887a3d1001271445u5f4d6f1dm1c0e95c058f49f7d@mail.gmail.com> Subject: Re: writing CGI::Session sessions only when necessary From: Perrin Harkins To: Jonathan Swartz Cc: modperl@perl.apache.org Content-Type: text/plain; charset=ISO-8859-1 On Tue, Jan 26, 2010 at 7:42 PM, Jonathan Swartz wrote: > On our site we create a new CGI::Session object at the beginning of the > request, so that it can be used anywhere in the web code. > > However, sessions are rarely written to, so at the end of the request I'd > like to avoid actually writing out a new session to backing store unless a > param actually got set. It might be simpler to just write immediately when you set a param. It's simple and foolproof, and it's only a negative for performance if you normally set multiple params in a single request. If your ultimate goal is to fix performance on your servers, I'd recommend looking at using encrypted data in a cookie and ditching server-side session storage. - Perrin