Combine is a small PHP script and some clever URL rewriting designed to speed up the loading of pages that use many or large css and javascript files.
It is good but how can you integrate it with your CakePHP project? And solution comes with the question :).
Download a copy of combine.php
and drop it into your app/webroot
directory (or whatever your application folder name is XXX/webroot/
).
Open the file in your text editor and change lines:
1 2 3 |
|
with
1 2 3 |
|
Open your app/webroot/.htaccess
file and add those two lines
1 2 |
|
That’s all! Check download times of your css and javascript files with a tool like Firebug. A fatty 527KB ext-all.js
javascript framework file compressed to 140KB! Amazing ha?