Return-Path: Delivered-To: apmail-httpd-modules-dev-archive@minotaur.apache.org Received: (qmail 10865 invoked from network); 4 Nov 2009 12:24:09 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 4 Nov 2009 12:24:09 -0000 Received: (qmail 13386 invoked by uid 500); 4 Nov 2009 12:24:08 -0000 Delivered-To: apmail-httpd-modules-dev-archive@httpd.apache.org Received: (qmail 13347 invoked by uid 500); 4 Nov 2009 12:24:08 -0000 Mailing-List: contact modules-dev-help@httpd.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: modules-dev@httpd.apache.org Delivered-To: mailing list modules-dev@httpd.apache.org Received: (qmail 13337 invoked by uid 99); 4 Nov 2009 12:24:07 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 04 Nov 2009 12:24:07 +0000 X-ASF-Spam-Status: No, hits=-1.4 required=5.0 tests=BAYES_00,HTML_MESSAGE,MIME_HEADER_CTYPE_ONLY,RCVD_IN_SORBS_WEB X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of jayasingh.samuel@hotmail.com designates 65.55.116.38 as permitted sender) Received: from [65.55.116.38] (HELO blu0-omc1-s27.blu0.hotmail.com) (65.55.116.38) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 04 Nov 2009 12:24:05 +0000 Received: from BLU123-W14 ([65.55.116.7]) by blu0-omc1-s27.blu0.hotmail.com with Microsoft SMTPSVC(6.0.3790.3959); Wed, 4 Nov 2009 04:23:43 -0800 Message-ID: Content-Type: multipart/alternative; boundary="_6adc6817-7ba9-4d90-8fa9-6e2a02039780_" X-Originating-IP: [124.124.231.235] From: Jaysingh Samuel To: Subject: RE: Minification of js files. Date: Wed, 4 Nov 2009 17:53:44 +0530 Importance: Normal In-Reply-To: <17550da70911032305i441a15d6k5551f40165021204@mail.gmail.com> References: <17550da70911030248u1f70b2bduea5e2c75e7e9229e@mail.gmail.com> X-OriginalArrivalTime: 04 Nov 2009 12:23:43.0907 (UTC) FILETIME=[A6645730:01CA5D49] --_6adc6817-7ba9-4d90-8fa9-6e2a02039780_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Jerome=2C Thanks a lot for your valuable input.=20 thanks=2C=20 Jaysingh=20 > Date: Wed=2C 4 Nov 2009 08:05:25 +0100 > Subject: Re: Minification of js files. > From: jerome.renard@gmail.com > To: modules-dev@httpd.apache.org >=20 > Hello :) >=20 > On Wed=2C Nov 4=2C 2009 at 5:42 AM=2C Jaysingh Samuel > wrote: > > > > Hi=2C > > Instead of minifying each of the javascript file separately and then us= ing=2C is there a way of embedding the jsmin/(stripping of the blank lines)= in the filter module of the apache so that the js file will be minified on= the fly. >=20 > Since there is a jsmin.c available here : > http://www.crockford.com/javascript/jsmin.c I think you could bundle > it in your module and use the JSMin API. > However it might not make much sense to minify a javascript for every > request. Do your Javascript files change that often ? > I think you have to choose between the two following solutions : >=20 > 1. To pre minify javascript files by running a shell/ant/Make script > calling jsmin and push them in your HTTP directory > 2. To minify Javascript files by embedding jsmin.c in a custom output > filter module so it is done on the fly >=20 > Pro and cons of option 1 are : > Pro : easy to do=2C easy to maintain > Cons : you have to run it after each update of you JS file(s)=2C i.e it > is not done on the fly >=20 > Pro and cons of option 2 are : > Pro : "minification" is done on the fly > Cons : longer to create (you have to write C code)=2C harder to > maintain=2C will use much more server resources than option 1 >=20 > It is up to you to make your decision based on your context. >=20 > Hope that helps >=20 > :) =20 _________________________________________________________________ New Windows 7: Find the right PC for you. Learn more. http://windows.microsoft.com/shop= --_6adc6817-7ba9-4d90-8fa9-6e2a02039780_--