<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Jonas Stendahl Portfolio &#187; cache</title>
	<atom:link href="http://www.jyggen.com/tag/cache/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.jyggen.com</link>
	<description>Web Application Developer from Uppsala, Sweden</description>
	<lastBuildDate>Tue, 13 Dec 2011 14:14:09 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Minify &#8211; compress your files on the fly!</title>
		<link>http://www.jyggen.com/code/minify-compress-your-files-on-the-fly/</link>
		<comments>http://www.jyggen.com/code/minify-compress-your-files-on-the-fly/#comments</comments>
		<pubDate>Fri, 26 Mar 2010 12:18:35 +0000</pubDate>
		<dc:creator>Jonas Stendahl</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[cache]]></category>
		<category><![CDATA[compress]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Minify]]></category>
		<category><![CDATA[on the fly]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.jyggen.com/?p=116</guid>
		<description><![CDATA[Are you, like me, one of those who keeps JavaScript and CSS in multiple files for better structure and who don’t compress the code because you want to have the readability intact in your development environment? Well, then this script &#8230; <a href="http://www.jyggen.com/code/minify-compress-your-files-on-the-fly/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Are you, like me, one of those who keeps JavaScript and CSS in multiple files for better structure and who don’t compress the code because you want to have the readability intact in your development environment? Well, then this script is for you!</p>
<p>I give you Minify, a script which combines and compress your files on the fly. This way the files get smaller and the client only have to make one request to the server. Just include the class in the top of the page, somewhere before you include your CSS/JavaScript, give it a few parameters and it will do everything for you. Now you can have how many files you want and edit whenever you want as long as you include the CSS/JavaScript file generated by Minify.<span id="more-116"></span></p>
<p>But, won’t it slow down the execution of the page to run Minify every time? No! First of all, you’ll barely notice when the script actually runs because it doesn’t take any time at all. And second, it won’t run the script if there is no change to the source files. The script is smart enough to store the hash of every file in a cache file and will just check against it.</p>
<p>I made the function which Minify is based on a few months ago when I tried to figure out a way to compress my files automatically and I’ve used it for two or three projects. I realized that there should be an easier way to integrate the script into an existing code and that’s why I made Minify. The original script used PHP’s function filemtime() to check if a file had been modified since the minified version was generated. It work decently, but if you copy/paste an old file from another project it will still have the same modified time and therefore will the minified version be newer. This and a lot of other stuff were fixed when I changed to the existing system, which is faster too!</p>
<p>So, what’s next for Minify? Well, first of all I want to fix all the issues listed below and more optimization. A nice thing would be native JavaScript and CSS compression in Minify.class.php to keep it in one file. Can you think of something else to add? Suggest it!</p>
<p>Please comment below what you think about the script. Don&#8217;t be afraid to report issues, improvements, feedback etc. below and remeber to tell your friends! <img src='http://www.jyggen.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><strong>Download: </strong>Minify is now hosted on <a href="https://github.com/jyggen/Minify">GitHub</a>, fetch the latest source code there!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jyggen.com/code/minify-compress-your-files-on-the-fly/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using apc
Page Caching using apc
Database Caching 9/16 queries in 0.003 seconds using apc
Object Caching 318/332 objects using apc

Served from: www.jyggen.com @ 2012-02-07 02:15:10 -->
