Thanks tlphipps,

Your script is an example of "on-the-fly" compression right?

Think I got it now! :)

On Oct 15, 12:18 pm, tlphipps <[EMAIL PROTECTED]> wrote:
> If you're using PHP on the backend, here is the solution we use:
>
> <?php
> //define array that will hold an entry for each javascript file
> $jsfiles = array();
>
> //just add a new line for each javascript file needed
> $jsfiles[] = "jquery.yuimin.js";
> $jsfiles[] = "jquery.autocomplete.yuimin.js";
> $jsfiles[] = "jquery.bgiframe.yuimin.js";
> $jsfiles[] = "jquery.blockui.yuimin.js";
> $jsfiles[] = "jquery.contextmenu.yuimin.js";
> $jsfiles[] = "jquery.cookie.yuimin.js";
> $jsfiles[] = "jquery.cookiejar.yuimin.js";
> $jsfiles[] = "jquery.curvycorners.yuimin.js";
> $jsfiles[] = "jquery.date.yuimin.js";
> $jsfiles[] = "jquery.datepicker.yuimin.js";
> $jsfiles[] = "jquery.filetree.yuimin.js";
> $jsfiles[] = "jquery.history_remote.yuimin.js";
> $jsfiles[] = "jquery.inplace.yuimin.js";
> $jsfiles[] = "jquery.json.yuimin.js";
> $jsfiles[] = "jquery.livequery.yuimin.js";
> $jsfiles[] = "jquery.media.yuimin.js";
> $jsfiles[] = "jquery.metadata.yuimin.js";
> $jsfiles[] = "jquery.scrollto.yuimin.js";
> $jsfiles[] = "jquery.tablesorter.yuimin.js";
> $jsfiles[] = "jquery.tablesorter.cookie.yuimin.js";
> $jsfiles[] = "jquery.tabs.yuimin.js";
> $jsfiles[] = "jquery.thickbox.yuimin.js";
> $jsfiles[] = "jquery.tooltip.yuimin.js";
> $jsfiles[] = "ui.core.yuimin.js";
> $jsfiles[] = "ui.draggable.yuimin.js";
>
> ob_start('ob_gzhandler'); //start output buffering using gzip
> compression
> header("Content-type: text/javascript; charset: UTF-8"); //declare
> this to the browser as javascript
> //setup header info to force caching
> header("Cache-Control: must-revalidate, public");
> $offset = 60 * 60 * 4;
> $ExpStr = "Expires: " . gmdate("D, d M Y H:i:s",time() + $offset) . "
> GMT";
> header($ExpStr); //set expiration header
>
> foreach ($jsfiles as $fn) {
>         echo file_get_contents($fn);
>         echo ";\n"; // accommodate scripts which are missing a trailing
> semicolon}
>
> ob_end_flush(); //output the content
> ?>
>
> On Oct 15, 10:12 am, "Chris Jordan" <[EMAIL PROTECTED]> wrote:
>
> > Yeah, nothing bugs me more than when I'm searching for the answer to
> > something on google only to come up with fifteen mailing list posts on the
> > subject where the only answer is some smart-ass telling me to search google
> > for it. :o/
>
> > On Wed, Oct 15, 2008 at 9:06 AM, Alex Weber <[EMAIL PROTECTED]> wrote:
>
> > > lol
> > > tried that, had to wade through a lot of stuff but I guess I found my
> > > answers.
>
> > > if you knew it off the top of your head wouldn't hurt to just say it!
> > > =P
>
> > > thanks!
>
> > > -Alex
>
> > > On Oct 15, 9:23 am, MorningZ <[EMAIL PROTECTED]> wrote:
> > > > Answers to your questions, every single one of them
>
> > > >http://www.google.com/search?q=gzip
>
> > > > On Oct 15, 7:58 am, Alex Weber <[EMAIL PROTECTED]> wrote:
>
> > > > > the recomendation out there is serve your JS "minified + gzipped"....
>
> > > > > ok, i downloaded the YUI minified and use it to minify all my files
> > > > > (~50% size reduction)... now whats all this talk about gzipping?
>
> > > > > do i have to manually download gzip and do the same thing? AFTER I
> > > > > minify the file?
>
> > > > > (or write a batch that does both?)
>
> > > > > or if i enable mod_deflate it takes care of the gzipping?
>
> > > > > thanks! :)
>
> > --http://cjordan.us

Reply via email to