Today we want to introduce you to the Static File Optimization Script called lightscript. We use some techniques of the script in our web-based projects. The handling is very easy and the effect is huge. Lightscript allows the user to gzip, merge and cache the merged files on the fly. Now, we have to explain some aspects of lightscript.
$cache_dir and $script_dir are the variables that point out the place where the scripts are located and where lightscript can store cached files. Make sure that these directories are writeable (777). In the downloadable archive we have created 2 folders (scripts & cache). You can use this folders by default.
Lightscript also implements some cache directives.
header("Expires: ".date('r',mktime(0,0,0,12,12,date('Y')+5)));
header("Pragma: public");
header("Cache-control: public");
http://example.com/scripts/lightscript.php?q=prototype.js|scriptaculous.js|main.js&c=1