I do something slightly similar with php. First I load all my js local file
paths into a $_SESSION var. Then, my app calls a single php page containing
the following. Works great and really reduces the size. I do the same thing
with my css too:
<?php
# SCRIPT SUMMARY
# This script is called directly from the html header on a page
# Set output beffering to output g-zipped file
# Set the proper headers for javascript document type and browsering
caching.
# Require each javascript file
# Empty the $_SESSION var containing the list of Javascript files
session_start();
ob_start ("ob_gzhandler");
header("Content-type: text/javascript; charset: UTF-8");
header("Cache-Control: must-revalidate");
$offset = 60 * 60 ;
header("Expires: " . gmdate("D, d M Y H:i:s",time() + $offset) . " GMT");
foreach ($_SESSION['JS_TO_INCLUDE'] as $js_location) {
require_once($js_location);
}
# clear out the javascript $_SESSION var (prevents direct download unless
logged in)
$_SESSION['JS_TO_INCLUDE']=array();
?>
Giuliano Marcangelo wrote:
>
> Su,
>
> came across this article,
> http://rakaz.nl/item/make_your_pages_load_faster_by_combining_and_compressing_javascript_and_css_files
>
> not a php guy,so do not know how effective this would be
>
>
--
View this message in context:
http://www.nabble.com/Q-on-optimizing-multiple-plugin-use-packing-tf3186717.html#a8873994
Sent from the JQuery mailing list archive at Nabble.com.
_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/