<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: AssetPackager for&#160;CakePHP</title>
	<atom:link href="http://blog.bradleyboy.com/2007/07/28/assetpackager-for-cakephp/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.bradleyboy.com/2007/07/28/assetpackager-for-cakephp/</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Sun, 25 Jul 2010 17:20:16 -0700</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Chris</title>
		<link>http://blog.bradleyboy.com/2007/07/28/assetpackager-for-cakephp/comment-page-1/#comment-5325</link>
		<dc:creator>Chris</dc:creator>
		<pubDate>Wed, 23 Apr 2008 10:25:17 +0000</pubDate>
		<guid isPermaLink="false">http://blog.bradleyboy.com/2007/07/28/assetpackager-for-cakephp/#comment-5325</guid>
		<description>Yes it no longer works... even with the configure::read it gives an error:
Notice (8): Undefined offset:  -1 [APP\vendors\asset_packager\asset_helper.php, line 48]</description>
		<content:encoded><![CDATA[<p>Yes it no longer works&#8230; even with the configure::read it gives an error:<br />
Notice (8): Undefined offset:  -1 [APP\vendors\asset_packager\asset_helper.php, line 48]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: goed</title>
		<link>http://blog.bradleyboy.com/2007/07/28/assetpackager-for-cakephp/comment-page-1/#comment-4082</link>
		<dc:creator>goed</dc:creator>
		<pubDate>Fri, 07 Dec 2007 01:15:00 +0000</pubDate>
		<guid isPermaLink="false">http://blog.bradleyboy.com/2007/07/28/assetpackager-for-cakephp/#comment-4082</guid>
		<description>Thanks for the tutorial, this helped me alot and saved me tons of time :)

regards,
goed</description>
		<content:encoded><![CDATA[<p>Thanks for the tutorial, this helped me alot and saved me tons of time <img src='http://blog.bradleyboy.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>regards,<br />
goed</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Aaron Shafovaloff</title>
		<link>http://blog.bradleyboy.com/2007/07/28/assetpackager-for-cakephp/comment-page-1/#comment-3722</link>
		<dc:creator>Aaron Shafovaloff</dc:creator>
		<pubDate>Mon, 05 Nov 2007 22:18:18 +0000</pubDate>
		<guid isPermaLink="false">http://blog.bradleyboy.com/2007/07/28/assetpackager-for-cakephp/#comment-3722</guid>
		<description>Bradley, this needs to be updated for the latest SVN build of CakePHP 1.2. They aren&#039;t using global variables anymore like DEBUG. Try:

Configure::read(&#039;debug&#039;);

Also, I think the way they do the console has changed?</description>
		<content:encoded><![CDATA[<p>Bradley, this needs to be updated for the latest SVN build of CakePHP 1.2. They aren&#8217;t using global variables anymore like DEBUG. Try:</p>
<p>Configure::read(&#8217;debug&#8217;);</p>
<p>Also, I think the way they do the console has changed?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Aaron Shafovaloff</title>
		<link>http://blog.bradleyboy.com/2007/07/28/assetpackager-for-cakephp/comment-page-1/#comment-3718</link>
		<dc:creator>Aaron Shafovaloff</dc:creator>
		<pubDate>Mon, 05 Nov 2007 20:02:03 +0000</pubDate>
		<guid isPermaLink="false">http://blog.bradleyboy.com/2007/07/28/assetpackager-for-cakephp/#comment-3718</guid>
		<description>Wonderful! I can put this to immediate use!

PS Beautiful blog template.</description>
		<content:encoded><![CDATA[<p>Wonderful! I can put this to immediate use!</p>
<p>PS Beautiful blog template.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Automatic Asset Packer CakePHP Helper :: PseudoCoder.com</title>
		<link>http://blog.bradleyboy.com/2007/07/28/assetpackager-for-cakephp/comment-page-1/#comment-2814</link>
		<dc:creator>Automatic Asset Packer CakePHP Helper :: PseudoCoder.com</dc:creator>
		<pubDate>Thu, 09 Aug 2007 04:59:11 +0000</pubDate>
		<guid isPermaLink="false">http://blog.bradleyboy.com/2007/07/28/assetpackager-for-cakephp/#comment-2814</guid>
		<description>[...] A little while ago I wrote a post about how I manually combine/pack Javascript files. Even as I was writing it I was thinking &#8220;hey, this would be a great CakePHP plugin/component/helper. Before I could code it Brad Daily from beat me to it. However there are a couple of things I didn&#8217;t like about his method, particularly the need for configuration files (how anti Cake!) and the need to run a console script to generated the packed versions. [...]</description>
		<content:encoded><![CDATA[<p>[...] A little while ago I wrote a post about how I manually combine/pack Javascript files. Even as I was writing it I was thinking &#8220;hey, this would be a great CakePHP plugin/component/helper. Before I could code it Brad Daily from beat me to it. However there are a couple of things I didn&#8217;t like about his method, particularly the need for configuration files (how anti Cake!) and the need to run a console script to generated the packed versions. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Grant Cox</title>
		<link>http://blog.bradleyboy.com/2007/07/28/assetpackager-for-cakephp/comment-page-1/#comment-2710</link>
		<dc:creator>Grant Cox</dc:creator>
		<pubDate>Mon, 30 Jul 2007 09:53:06 +0000</pubDate>
		<guid isPermaLink="false">http://blog.bradleyboy.com/2007/07/28/assetpackager-for-cakephp/#comment-2710</guid>
		<description>Bradley - I agree that this could be done by a deployment script, and is probably a better way to do it.  However, I generally have to work in a studio full of designers, and even version control is too complicated for them.  It would be nice if we could enforce a &quot;only developers update the live site&quot;, but the fact is they are used to FTP and it is more efficient to let them edit CSS directly.  And I haven&#039;t used Capistrano before, but ANT tasks weren&#039;t so amazing that I wanted to enforce them!

I have been playing around with implementing this functionality into the HeadHelper, and it&#039;s been going quite well.

I&#039;ve realised that compressing all of the JS into a single file isn&#039;t necessarily more efficient.  For the cases where I have a little custom JS on each page, it means that the larger libraries are duplicated into each page&#039;s unique package.  So I&#039;ll rework this to support grouping, causing more than a single package to be created.

Also, the file naming is a little annoying.  As you pointed out it is a good idea to have a unique filename for each modified version to avoid browser caching.  However, when a new version is created it would be nice to destroy all the old ones (just to clean up), and keeping track of these is annoying.  I appreciate the simplicity of the config file :)

Anyway, I&#039;ll keep on plugging.  It currently supports JsMin and Packer for JS, and CSS Tidy for the CSS.  And no change to any view files, as I already use the HeadHelper for all includes.</description>
		<content:encoded><![CDATA[<p>Bradley &#8211; I agree that this could be done by a deployment script, and is probably a better way to do it.  However, I generally have to work in a studio full of designers, and even version control is too complicated for them.  It would be nice if we could enforce a &#8220;only developers update the live site&#8221;, but the fact is they are used to FTP and it is more efficient to let them edit CSS directly.  And I haven&#8217;t used Capistrano before, but ANT tasks weren&#8217;t so amazing that I wanted to enforce them!</p>
<p>I have been playing around with implementing this functionality into the HeadHelper, and it&#8217;s been going quite well.</p>
<p>I&#8217;ve realised that compressing all of the JS into a single file isn&#8217;t necessarily more efficient.  For the cases where I have a little custom JS on each page, it means that the larger libraries are duplicated into each page&#8217;s unique package.  So I&#8217;ll rework this to support grouping, causing more than a single package to be created.</p>
<p>Also, the file naming is a little annoying.  As you pointed out it is a good idea to have a unique filename for each modified version to avoid browser caching.  However, when a new version is created it would be nice to destroy all the old ones (just to clean up), and keeping track of these is annoying.  I appreciate the simplicity of the config file <img src='http://blog.bradleyboy.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Anyway, I&#8217;ll keep on plugging.  It currently supports JsMin and Packer for JS, and CSS Tidy for the CSS.  And no change to any view files, as I already use the HeadHelper for all includes.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: bradleyboy</title>
		<link>http://blog.bradleyboy.com/2007/07/28/assetpackager-for-cakephp/comment-page-1/#comment-2708</link>
		<dc:creator>bradleyboy</dc:creator>
		<pubDate>Mon, 30 Jul 2007 06:50:29 +0000</pubDate>
		<guid isPermaLink="false">http://blog.bradleyboy.com/2007/07/28/assetpackager-for-cakephp/#comment-2708</guid>
		<description>Grant &amp; Geoff - Thanks for the comments, good input.

One thing that is important to point out is that the timestamp portion of the filename is key because of another optimization trick - &lt;a href=&quot;http://developer.yahoo.com/performance/rules.html#expires&quot; rel=&quot;nofollow&quot;&gt;Expires Headers&lt;/a&gt;. With the unique filename, you can set the expires header for your javascript and CSS files to way out in the future, since any change to those files will result in a new filename and thus your user&#039;s browser cache of your previous file won&#039;t cause problems.

I understand your points with regards to automation, but I think that is a job left for your deployment process. I use Capistrano for deployment, so I just dropped in a line to my deploy recipe to run AssetPackager after the latest code has been put in place. Same thing for our packaging script for SlideShowPro Director. I think one thing many Cake bakers can learn from the Rails crowd is good, automated deployment.

That being said, the script ought to have a fallback of some sorts should the compressed version be absent. Maybe if no compressed version exists we just revert to including all the singles just like we do in development and print a warning via a comment in the HTML.

Anyway, all that said I&#039;m still open to any code submissions you might have to make the cleaner/easier.</description>
		<content:encoded><![CDATA[<p>Grant &#038; Geoff &#8211; Thanks for the comments, good input.</p>
<p>One thing that is important to point out is that the timestamp portion of the filename is key because of another optimization trick &#8211; <a href="http://developer.yahoo.com/performance/rules.html#expires" rel="nofollow">Expires Headers</a>. With the unique filename, you can set the expires header for your javascript and CSS files to way out in the future, since any change to those files will result in a new filename and thus your user&#8217;s browser cache of your previous file won&#8217;t cause problems.</p>
<p>I understand your points with regards to automation, but I think that is a job left for your deployment process. I use Capistrano for deployment, so I just dropped in a line to my deploy recipe to run AssetPackager after the latest code has been put in place. Same thing for our packaging script for SlideShowPro Director. I think one thing many Cake bakers can learn from the Rails crowd is good, automated deployment.</p>
<p>That being said, the script ought to have a fallback of some sorts should the compressed version be absent. Maybe if no compressed version exists we just revert to including all the singles just like we do in development and print a warning via a comment in the HTML.</p>
<p>Anyway, all that said I&#8217;m still open to any code submissions you might have to make the cleaner/easier.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Geoff Ford</title>
		<link>http://blog.bradleyboy.com/2007/07/28/assetpackager-for-cakephp/comment-page-1/#comment-2706</link>
		<dc:creator>Geoff Ford</dc:creator>
		<pubDate>Mon, 30 Jul 2007 05:05:54 +0000</pubDate>
		<guid isPermaLink="false">http://blog.bradleyboy.com/2007/07/28/assetpackager-for-cakephp/#comment-2706</guid>
		<description>Awesome utility.  It&#039;s going into to my collection :)

I also would like to see it a little more automated.  I like the idea of in DEBUG = 0 it just has a file_exists() and skips all the timestamp stuff.

Great work.</description>
		<content:encoded><![CDATA[<p>Awesome utility.  It&#8217;s going into to my collection <img src='http://blog.bradleyboy.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>I also would like to see it a little more automated.  I like the idea of in DEBUG = 0 it just has a file_exists() and skips all the timestamp stuff.</p>
<p>Great work.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Grant Cox</title>
		<link>http://blog.bradleyboy.com/2007/07/28/assetpackager-for-cakephp/comment-page-1/#comment-2705</link>
		<dc:creator>Grant Cox</dc:creator>
		<pubDate>Mon, 30 Jul 2007 04:49:03 +0000</pubDate>
		<guid isPermaLink="false">http://blog.bradleyboy.com/2007/07/28/assetpackager-for-cakephp/#comment-2705</guid>
		<description>This is very cool.  It&#039;s something that should really be used on every project (no real reason not to), but for that it could be a little more automated and transparent.

Manual updating via console.  I just know that people will forget this step after updating their JS, and pull their hair out wondering why the compressed version just doesn&#039;t work properly.  How about it automatically generates the compressed files if they don&#039;t exist?  Perhaps running as DEBUG &gt; 0 destroys any existing compressed versions (in case they are out of date), and so the first request of DEBUG 0 will create them again?  It would be one additional file_exists check every production request, but you&#039;ve probably got higher overhead than that with the current timestamp method (I havne&#039;t looked at your code yet).

The config file.  I usually have a few CSS / JS includes in each layout which would be easily replaced as you displayed above.  But I also usually have custom CSS / JS includes in each of my views - and I would like these to be included in the single page JS/CSS, without having to manage combinations in the config file.
What about if this helper worked like RosSoft&#039;s HeadHelper ( http://rossoft.wordpress.com/2006/03/28/register-head-tags-from-helpers-2/ ), or the &quot;echo $scripts_for_layout;&quot; that Cake 1.2 provides?  The AssetPackager can generate some identifier from all the script names that are passed to it, and automatically know what file to actually generate/include.

I&#039;m busy on a non-Cake project at the moment so I can&#039;t really implement these myself just yet.  But if you don&#039;t do it first I do plan to - I&#039;m using a customised version of the HeadHelper at the moment and this would be a good addition.</description>
		<content:encoded><![CDATA[<p>This is very cool.  It&#8217;s something that should really be used on every project (no real reason not to), but for that it could be a little more automated and transparent.</p>
<p>Manual updating via console.  I just know that people will forget this step after updating their JS, and pull their hair out wondering why the compressed version just doesn&#8217;t work properly.  How about it automatically generates the compressed files if they don&#8217;t exist?  Perhaps running as DEBUG &gt; 0 destroys any existing compressed versions (in case they are out of date), and so the first request of DEBUG 0 will create them again?  It would be one additional file_exists check every production request, but you&#8217;ve probably got higher overhead than that with the current timestamp method (I havne&#8217;t looked at your code yet).</p>
<p>The config file.  I usually have a few CSS / JS includes in each layout which would be easily replaced as you displayed above.  But I also usually have custom CSS / JS includes in each of my views &#8211; and I would like these to be included in the single page JS/CSS, without having to manage combinations in the config file.<br />
What about if this helper worked like RosSoft&#8217;s HeadHelper ( <a href="http://rossoft.wordpress.com/2006/03/28/register-head-tags-from-helpers-2/" rel="nofollow">http://rossoft.wordpress.com/2006/03/28/register-head-tags-from-helpers-2/</a> ), or the &#8220;echo $scripts_for_layout;&#8221; that Cake 1.2 provides?  The AssetPackager can generate some identifier from all the script names that are passed to it, and automatically know what file to actually generate/include.</p>
<p>I&#8217;m busy on a non-Cake project at the moment so I can&#8217;t really implement these myself just yet.  But if you don&#8217;t do it first I do plan to &#8211; I&#8217;m using a customised version of the HeadHelper at the moment and this would be a good addition.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sam&#8217;s random musings &#187; Mod Expires</title>
		<link>http://blog.bradleyboy.com/2007/07/28/assetpackager-for-cakephp/comment-page-1/#comment-2692</link>
		<dc:creator>Sam&#8217;s random musings &#187; Mod Expires</dc:creator>
		<pubDate>Sat, 28 Jul 2007 21:22:29 +0000</pubDate>
		<guid isPermaLink="false">http://blog.bradleyboy.com/2007/07/28/assetpackager-for-cakephp/#comment-2692</guid>
		<description>[...] Yahoo! recently released an amazing tool called &#8220;YSlow&#8221;. It helps analyze the pages you&#8217;ve built and find problem points and bottlenecks. As bradleyboy said, there is nothing quite like working to fix that letter grade. [...]</description>
		<content:encoded><![CDATA[<p>[...] Yahoo! recently released an amazing tool called &#8220;YSlow&#8221;. It helps analyze the pages you&#8217;ve built and find problem points and bottlenecks. As bradleyboy said, there is nothing quite like working to fix that letter grade. [...]</p>
]]></content:encoded>
	</item>
</channel>
</rss>
