Sunday, August 5, 2012

LampCMS Official distribution zip archive

My Question on Support site for LampCMS project

The Official distribution of Lampcms is finally available in the zip archive.
It can always be downloaded from the www.lampcms.com website from the "Download" link.

It's recommended to use this zip file for production installation.
The main difference between the zip based release and downloading a zip from gitbub is that
the source code on github does not include the minified versions of javascript and css files.

The minified version of qa.js is created during the build process. I use phing as a build tool.
The way minified version of qa.js is created is this:
First a release version number is incremented for each release.
For example if latest version of previous build was 0.1.60, then the build tool automatically increments the minor version to 0.1.61
This number '0.1.61' then replaces the placeholder @package_version@ in all source files.
The most important place where this placeholder is used is in Object.php
there is a line:
const VERSION_ID = '@package_version@';

The minified version of javascript is then created and save as qa_0.1.61.js (uses the build version as part of the file name)
By the way, I use YUI compressor java tool to minify javascript and css file.

So after the build is complete the program will have a constant VERSION_ID that holds the value of actual build version.

This VERSION_ID is then used when including a minified javascript file.
So now the value of javascript src in the generated html will look something like this:
<script type="text/javascript" src="http://support.lampcms.com/js/min/qa_0.1.65.js"></script>

You should configure your web server to send long-lived expiration header for all files served from the js/min directory so browser will cache the minified javascripts. This will significantly improve the load time of all you pages.

Click here to post your reply


No comments:

Post a Comment