My favorites | Sign in
Project Logo
             
Code license: Apache License 2.0
Labels: coldfusion, cfml, css, javascript
Feeds:
People details
Project owners:
  jroberts1

Combine.CFC

Combine multiple javascript or CSS files into a single, compressed, HTTP request.

Allows you to change this:

<script src='file1.js' type='text/javascript'></script>
<script src='file2.js' type='text/javascript'></script>
<script src='file3.js' type='text/javascript'></script>

To this:

<script src='combine.cfm?files=file1.js,file2.js,file3.js' type='text/javascript'></script>

...combining and compressing multiple javascript or css files into one http request.

How do I use it?

How to add the Java to your classpath (required for css and js compression)

  1. Determine where you will place your Java, it must go in a directory in your Coldfusion class path. This could either be cf_install_dir\lib, or a custom directory path which has been added to the Coldfusion class path (through Coldfusion's admin/config)
  2. Add the code to the class_path_dir as determined in step 1, using one of the following 2 methods:
    1. copy combine.jar (archive) to your class_path_dir; or
    2. copy the 'com' directory and contents to your class_path_dir (directory structure must not change).
  3. Restart Coldfusion

Why?

How does it work?

Real Stats - an example of the benefits of ETags

Real statistics from one of our sites (obtained via Fusion Reactor). Note how many 304 status codes are returned. These mean that the request instantly ends, and the browser uses its local version. This happens when the browser's version is the same as the server version, and results in less load on your server!

response count notes
200 OK 10346 normal response, resturns content
304 Not Modified 3038 server load reduced!
500 Internal Server Error 11 my bugs?!
301 Moved Permanently 187
302 Found 48
404 Not Found 58

More

Contact

Please feel free to contact me with any issues, ideas and experiences you have with Combine.cfc. jroberts1{at}gmail{dot}com

Credits

All I have done here is pulled together some other peoples' clever work, into a workable solution for Coldfusion apps. So loads of credit to the following:









Hosted by Google Code