<?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>Cakephp.nu blog &#187; lighttpd</title>
	<atom:link href="http://www.cakephp.nu/t/lighttpd/feed" rel="self" type="application/rss+xml" />
	<link>http://www.cakephp.nu</link>
	<description>Cake and cookies by Jippi</description>
	<lastBuildDate>Mon, 03 Nov 2008 15:36:32 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Yay &#8211; my dell new server is now online :D</title>
		<link>http://www.cakephp.nu/my-new-dell-server-is-now-online</link>
		<comments>http://www.cakephp.nu/my-new-dell-server-is-now-online#comments</comments>
		<pubDate>Wed, 16 Jul 2008 22:15:37 +0000</pubDate>
		<dc:creator>Christian Winther</dc:creator>
				<category><![CDATA[Random]]></category>
		<category><![CDATA[news]]></category>
		<category><![CDATA[dell]]></category>
		<category><![CDATA[dovecot]]></category>
		<category><![CDATA[english]]></category>
		<category><![CDATA[lighttpd]]></category>

		<guid isPermaLink="false">http://www.cakephp.nu/?p=22</guid>
		<description><![CDATA[
Finally I got the good news from my new hosting company I can hardly wait to get it FreeBSD 7.0 installed on it and setup a nice vhost system with Lighttpd + PostgreSQL. It&#8217;s gonna be awsome. The server I&#8217;m currently using is &#8216;only&#8217; Dual core XEON w/ 3.5Gb ram, and some random SATA drives, [...]
]]></description>
			<content:encoded><![CDATA[<p>Finally I got the good news from my <a href="http://www.logiqit.com">new hosting company</a></p>
<p>I can hardly wait to get it FreeBSD 7.0 installed on it and setup a nice vhost system with Lighttpd + PostgreSQL. It&#8217;s gonna be awsome.<br />
The server I&#8217;m currently using is &#8216;only&#8217; Dual core XEON w/ 3.5Gb ram, and some random SATA drives, so the improvement should be huge <img src='http://www.cakephp.nu/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<p>I&#8217;m quite excited, because its going to be my first server ever without Apache and MySQL installed. Or well, atleast until some stupid customer or what not (<a href="http://www.kosmosgrafisk.dk">Biesbjerg</a>?) demands it <img src='http://www.cakephp.nu/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>If I can find the time, I will write a guide on how I&#8217;m going to configure my server (Lighttpd, PostgreSQL, Dovecot + sendmail, quota, fast-cgi php5), it might be useful for someone <img src='http://www.cakephp.nu/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>Let me know if it has any interest to you guys <img src='http://www.cakephp.nu/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<h2>Specs</h2>
<p>- Dell PE 1950 III<br />
- PE1950 PCIE Riser (2 Slots) 1 S<br />
- <strong>Quad Core Xeon E5410 (2.33GHz, 2x6MB, 1333MHz FSB)</strong> (SMP supported)<br />
- <strong>4GB (2x2GB Dual Rank DIMMs) 667MHz FBD (up to 32 GB)</strong><br />
- <strong>3x 146GB SAS 10k 2.5&#8243; HDPE1950 III 2.5&#8243;</strong> HDD support chassis<br />
- Perc 6i Integrated Controller<br />
- 8X DVD-ROM Drive IDE<br />
- PE1950 III Non-Redundant Power Supply No Power Cord<br />
- TCP/IP Offload Engine 2P<br />
- Broadcom TCP/IP Offload Engine functionality (TOE) Not Enabled<br />
- PE1950 OpenManage kit and FI Driver<br />
- CFI EMEA Service. (SV-Hi) OR PowerEdge, RAID/partition<br />
- RAID 1 Single Container<br />
- RAID 0 (1 HDD)<br />
- Rack Rails Static Rapid 1 S<br />
- PE1950 III &#8211; C2,MSSR0,ADD IN PERC5i/6i/SAS6iR, min 2 / max 2 or 4</p>
<p>/Jippi</p>

	Tags: <a href="http://www.cakephp.nu/t/dell" title="dell" rel="tag">dell</a>, <a href="http://www.cakephp.nu/t/dovecot" title="dovecot" rel="tag">dovecot</a>, <a href="http://www.cakephp.nu/t/english" title="english" rel="tag">english</a>, <a href="http://www.cakephp.nu/t/lighttpd" title="lighttpd" rel="tag">lighttpd</a>, <a href="http://www.cakephp.nu/t/news" title="news" rel="tag">news</a><br />
]]></content:encoded>
			<wfw:commentRss>http://www.cakephp.nu/my-new-dell-server-is-now-online/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>open_basedir will slow you down &#8211; security vs. speed</title>
		<link>http://www.cakephp.nu/open_basedir-will-slow-you-down-security-vs-speed</link>
		<comments>http://www.cakephp.nu/open_basedir-will-slow-you-down-security-vs-speed#comments</comments>
		<pubDate>Fri, 21 Mar 2008 01:48:58 +0000</pubDate>
		<dc:creator>Christian Winther</dc:creator>
				<category><![CDATA[Random]]></category>
		<category><![CDATA[lighttpd]]></category>
		<category><![CDATA[english]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.cakephp.nu/open_basedir-will-slow-you-down-security-vs-speed</guid>
		<description><![CDATA[
Just a quickie. I’m working on some security enhancements for my new website project, and in that progress, I have moved away from Apache2.2.3 and now using Lighttpd instead. Lighttpd does not use the same method of invoking php as apache does (mod_php vs. fast-cgi php). In my eager to make the application as secure [...]
]]></description>
			<content:encoded><![CDATA[<p>Just a quickie.</p>
<p>I’m working on some security enhancements for my new website project, and in that progress, I have moved away from Apache2.2.3 and now using Lighttpd instead. Lighttpd does not use the same method of invoking php as apache does (mod_php vs. fast-cgi php).</p>
<p>In my eager to make the application as secure and locked down as possible, I went berserk in the php-cgi.ini file and turned on just about any security feature I could find (not safemode!), including the innocent looking switch called “open_basedir”.</p>
<p>That was rather late in the night, so when I resumed my work the following day, I have long forgotten about all the fancy security settings I had enabled in php. </p>
<p>A few hours ago I noticed that the complete render time for the front page suddenly was ~2seconds(!) &#8211; and comparing with apache’s load time for the same page (0.9s) I was quite disappointed at lighttpd and fastcgi, but refused to give up my new found love without a fair trial.</p>
<p>I attacked google with full force without finding any useful resources that might be able to explain my issue.. I was quite sure it was APC that did not function well in a fastcgi environment &#8211; and therefore my google madness was focused around the keywords “apc + fastcgi”  </p>
<p>While chatting to PatrickDK in the #lighttpd channel @ freenode, it suddenly hit me &#8211; let’s try to disable everything I have “fixed” last night &#8211; starting with XDebug, some 3rd party php modules (syck, memcache, simplexml, fileinfo) &#8211; and then, open_basedir flag.</p>
<p><b>And with just one line commented out in my php-cgi.ini file, the render time went from 2.4 to 0.5 seconds !!(!!) </b></p>
<p>So just a little note to you guys out there, beware of the open_basedir setting in a setup where you include many files, it is a rather costly feature to use. And when running fastcgi php in chroot()ed setup, its not really required anyway  </p>
<p><b>Its another +1 for lighty and fastcgi</b></p>
<p>And yes, I’m aware that open_basedir is slow because it has to validate EVERY file or path you work with inside php to check if its within the scope defined.</p>

	Tags: <a href="http://www.cakephp.nu/t/english" title="english" rel="tag">english</a>, <a href="http://www.cakephp.nu/t/lighttpd" title="lighttpd" rel="tag">lighttpd</a>, <a href="http://www.cakephp.nu/t/php" title="php" rel="tag">php</a><br />
]]></content:encoded>
			<wfw:commentRss>http://www.cakephp.nu/open_basedir-will-slow-you-down-security-vs-speed/feed</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Faster Page Loads &#8211; Bundle Your CSS and Javascript with lighttpd</title>
		<link>http://www.cakephp.nu/faster-page-loads-bundle-your-css-and-javascript-lighttpd-mod_magnet-lua</link>
		<comments>http://www.cakephp.nu/faster-page-loads-bundle-your-css-and-javascript-lighttpd-mod_magnet-lua#comments</comments>
		<pubDate>Tue, 18 Mar 2008 15:23:40 +0000</pubDate>
		<dc:creator>Christian Winther</dc:creator>
				<category><![CDATA[lighttpd]]></category>
		<category><![CDATA[lua]]></category>
		<category><![CDATA[english]]></category>
		<category><![CDATA[mod_magnet]]></category>

		<guid isPermaLink="false">http://www.cakephp.nu/lighttpd-mod_magnet-written-lua-concat-script</guid>
		<description><![CDATA[
Hello again, Preface This time I have been busy playing with Lighttpd and mod_magnet. I found a blog post where darix mentions a post from sitepoint where they demostrate a technique to speed up the HTTP GET of javascript and CSS files. Its quite simple really, instead of doing &#38;lt;link href=&#34;/css/styles1.css&#34; rel=&#34;stylesheet&#34; type=&#34;text/css&#34; /&#38;gt; &#38;lt;link [...]
]]></description>
			<content:encoded><![CDATA[<p>Hello again,</p>
<h3>Preface</h3>
<p>This time I have been busy playing with <a target="_blank" href="http://www.lighttpd.net/">Lighttpd</a> and <a target="_blank" href="http://trac.lighttpd.net/trac/wiki/Docs:ModMagnet">mod_magnet</a>. I found <a target="_blank" href="http://nordisch.org/2007/4/10/hah-it-s-not-only-me">a blog post </a>where <a target="_blank" href="http://nordisch.org/">darix </a> mentions a post from sitepoint where they demostrate <a target="_blank" href="http://www.sitepoint.com/blogs/2007/04/10/faster-page-loads-bundle-your-css-and-javascript/">a technique to speed up the HTTP GET of javascript and CSS files</a>. </p>
<p>Its quite simple really, instead of doing</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&amp;lt;link href=&quot;/css/styles1.css&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot; /&amp;gt;
&amp;lt;link href=&quot;/css/styles2.css&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot; /&amp;gt;
&amp;lt;link href=&quot;/css/styles3.css&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot; /&amp;gt;</pre></div></div>

<p>you simply do</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&amp;lt;link href=&quot;/css/styles1.css,styles2.css,styles3.css&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot; /&amp;gt;</pre></div></div>

<p>and then this script will automagic concat them together into one big file, and make lighty serve that one instead. (The same goes for javascript files, or anything really)</p>
<p>This could save ALOT of HTTP GET&#8217;s to your server, and increase the overall loadtime and performance of your site alot, especially if you use alot of Web2.0 stuff <img src='http://www.cakephp.nu/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>However, the Lua source for their script was not made public, so nobody could benifit from their otherwise impressive speed gains. <img src='http://www.cakephp.nu/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
<p>Until now.. or, well, almost &#8211; its not their script, but my own attempt to mimic what they did in pure <a target="_blank" href="http://www.lua.org/">Lua</a> <img src='http://www.cakephp.nu/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>I tried to keep the dependencies down to a minimum, however I decided to use one, md5.<br />
You can find the source <a target="_blank" href="http://www.tecgraf.puc-rio.br/~lhf/ftp/lua/#lmd5">here</a> (<a href="http://www.tecgraf.puc-rio.br/~lhf/ftp/lua/5.1/lmd5.tar.gz">5.1</a>, <a href="http://www.tecgraf.puc-rio.br/~lhf/ftp/lua/5.0/lmd5.tar.gz">5.0</a>)</p>
<h3>Config</h3>
<dl>
<dt>charset (Line 42)</dt>
<dd>Set it so it matches the headers in your lighttpd.conf file. Must match your mod_compress settings aswell to utilize that feature</dd>
<dt>prefix (Line 43)</dt>
<dd>Could be anything really, its just a mean to &#8220;namespace&#8221; your cached files so you can run the script with multiple configs</dd>
<dt>rootPath (Line 44)</dt>
<dd>The path to look for the files to concat, default should be fine for most  DOC_ROOT/js  and DOC_ROOT/css</dd>
<dt>concatRoot (Line 45)</dt>
<dd>The folder to store the concated files, can be anywhere <img src='http://www.cakephp.nu/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </dd>
</dl>
<h3>Setup</h3>
<ul>
<li>Put the source below somewhere on your disk, I asume you name it bundle.lua</li>
<li>Enable mod_magnet in lighttpd.conf</li>
<li>Add <u>magnet.attract-physical-path-to = ( &#8220;YOUR_PATH/bundle.lua&#8221; )</u> to your config where needed</li>
<li>Restart lighttpd</li>
<li>Modify your css/js links to utilize the new feature:)</li>
</ul>
<p>Optimal you can enable mod_compress aswell, bundle.lua works out of the box with any other lighttpd module you may have <img src='http://www.cakephp.nu/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<h3>Source</h3>
<p><a target="_blank" href="http://www.cakephp.nu/files/mod_magnet/bundle_0.1.lua">download source</a></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
</pre></td><td class="code"><pre class="lua" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">--- get stat information on a path</span>
<span style="color: #808080; font-style: italic;">-- @param path to stat</span>
<span style="color: #808080; font-style: italic;">-- @param the ftype to return</span>
<span style="color: #808080; font-style: italic;">-- @return false if ftype or path does not exist</span>
<span style="color: #b1b100;">function</span> file_info<span style="color: #66cc66;">&#40;</span>path, ftype<span style="color: #66cc66;">&#41;</span>
    <span style="color: #b1b100;">local</span> attr <span style="color: #66cc66;">=</span> lighty.stat<span style="color: #66cc66;">&#40;</span>path<span style="color: #66cc66;">&#41;</span>
    <span style="color: #b1b100;">if</span> attr <span style="color: #b1b100;">and</span> attr<span style="color: #66cc66;">&#91;</span>ftype<span style="color: #66cc66;">&#93;</span> <span style="color: #b1b100;">then</span>
        <span style="color: #b1b100;">return</span> attr<span style="color: #66cc66;">&#91;</span>ftype<span style="color: #66cc66;">&#93;</span>
    <span style="color: #b1b100;">end</span>
    <span style="color: #b1b100;">return</span> <span style="color: #b1b100;">false</span>
<span style="color: #b1b100;">end</span>
&nbsp;
<span style="color: #808080; font-style: italic;">--- Wrapper for reading a full file into a string</span>
<span style="color: #808080; font-style: italic;">-- @param filename Full path to the file</span>
<span style="color: #808080; font-style: italic;">-- @return a string with the content of the file</span>
<span style="color: #b1b100;">function</span> read_file<span style="color: #66cc66;">&#40;</span>filename<span style="color: #66cc66;">&#41;</span> 
    <span style="color: #b1b100;">local</span> content <span style="color: #66cc66;">=</span> <span style="color: #ff0000;">&quot;&quot;</span>
    <span style="color: #b1b100;">if</span> file_info<span style="color: #66cc66;">&#40;</span>filename, <span style="color: #ff0000;">&quot;is_file&quot;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #b1b100;">then</span>
        <span style="color: #b1b100;">local</span> file <span style="color: #66cc66;">=</span> <span style="color: #b1b100;">io.open</span><span style="color: #66cc66;">&#40;</span>filename, <span style="color: #ff0000;">&quot;r&quot;</span><span style="color: #66cc66;">&#41;</span>
        content <span style="color: #66cc66;">=</span> file:<span style="color: #b1b100;">read</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;*a&quot;</span><span style="color: #66cc66;">&#41;</span>
        <span style="color: #b1b100;">io.close</span><span style="color: #66cc66;">&#40;</span>file<span style="color: #66cc66;">&#41;</span>
    <span style="color: #b1b100;">end</span>
    <span style="color: #b1b100;">return</span> content
<span style="color: #b1b100;">end</span>
&nbsp;
<span style="color: #808080; font-style: italic;">--- Wrapper for writeing content to a file</span>
<span style="color: #808080; font-style: italic;">-- @param filename Full path to the destionation file</span>
<span style="color: #808080; font-style: italic;">-- @param content The string to write</span>
<span style="color: #b1b100;">function</span> write_cache<span style="color: #66cc66;">&#40;</span>filename, content<span style="color: #66cc66;">&#41;</span> 
    <span style="color: #b1b100;">local</span> file <span style="color: #66cc66;">=</span> <span style="color: #b1b100;">io.open</span><span style="color: #66cc66;">&#40;</span>filename, <span style="color: #ff0000;">&quot;w&quot;</span><span style="color: #66cc66;">&#41;</span>
    file:<span style="color: #b1b100;">write</span><span style="color: #66cc66;">&#40;</span>content<span style="color: #66cc66;">&#41;</span>
    <span style="color: #b1b100;">io.close</span><span style="color: #66cc66;">&#40;</span>file<span style="color: #66cc66;">&#41;</span>
<span style="color: #b1b100;">end</span>
&nbsp;
<span style="color: #808080; font-style: italic;">--- Concat multiple files into one file </span>
<span style="color: #808080; font-style: italic;">-- @param lighty lighty global variable passed to the method</span>
<span style="color: #808080; font-style: italic;">-- @param match The files that will be concat into a file</span>
<span style="color: #808080; font-style: italic;">-- @param fileExtension Do !NOT! include the dot ( . )</span>
<span style="color: #b1b100;">function</span> combine_files<span style="color: #66cc66;">&#40;</span>lighty, files, fileExtension<span style="color: #66cc66;">&#41;</span>
    <span style="color: #b1b100;">require</span> <span style="color: #ff0000;">&quot;md5&quot;</span> 
&nbsp;
    <span style="color: #b1b100;">local</span> charset       <span style="color: #66cc66;">=</span> <span style="color: #ff0000;">&quot;; charset=utf-8&quot;</span>
    <span style="color: #b1b100;">local</span> prefix        <span style="color: #66cc66;">=</span> <span style="color: #ff0000;">&quot;cache-&quot;</span>
    <span style="color: #b1b100;">local</span> rootPath      <span style="color: #66cc66;">=</span> lighty.env<span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">&quot;physical.doc-root&quot;</span><span style="color: #66cc66;">&#93;</span> .. fileExtension .. <span style="color: #ff0000;">&quot;/&quot;</span>
    <span style="color: #b1b100;">local</span> concatRoot     <span style="color: #66cc66;">=</span> <span style="color: #ff0000;">&quot;/tmp/cache/&quot;</span>
    <span style="color: #b1b100;">local</span> lastModified  <span style="color: #66cc66;">=</span> <span style="color: #cc66cc;">0</span>
&nbsp;
    <span style="color: #b1b100;">for</span> file <span style="color: #b1b100;">in</span> <span style="color: #b1b100;">string</span>.gmatch<span style="color: #66cc66;">&#40;</span>files, <span style="color: #ff0000;">&quot;(.-<span style="color: #000099; font-weight: bold;">\.</span>&quot;</span> .. fileExtension .. <span style="color: #ff0000;">&quot;),?&quot;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #b1b100;">do</span>
        <span style="color: #b1b100;">local</span> fullPath <span style="color: #66cc66;">=</span> rootPath .. file
        modTime <span style="color: #66cc66;">=</span> file_info<span style="color: #66cc66;">&#40;</span>fullPath, <span style="color: #ff0000;">&quot;st_mtime&quot;</span><span style="color: #66cc66;">&#41;</span>
        <span style="color: #b1b100;">if</span> <span style="color: #b1b100;">type</span><span style="color: #66cc66;">&#40;</span>modTime<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">==</span> <span style="color: #ff0000;">&quot;number&quot;</span> <span style="color: #b1b100;">then</span>
            lastModified <span style="color: #66cc66;">=</span> <span style="color: #b1b100;">math.max</span><span style="color: #66cc66;">&#40;</span>lastModified, modTime<span style="color: #66cc66;">&#41;</span>
        <span style="color: #b1b100;">end</span>            
     <span style="color: #b1b100;">end</span>
&nbsp;
     <span style="color: #b1b100;">local</span> hash <span style="color: #66cc66;">=</span> lastModified .. <span style="color: #ff0000;">&quot;-&quot;</span> .. md5.sumhexa<span style="color: #66cc66;">&#40;</span>files<span style="color: #66cc66;">&#41;</span>
     lighty.header<span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">&quot;Etag&quot;</span><span style="color: #66cc66;">&#93;</span> <span style="color: #66cc66;">=</span> <span style="color: #ff0000;">'&quot;'</span> .. hash ..<span style="color: #ff0000;">'&quot;'</span>
&nbsp;
    <span style="color: #b1b100;">local</span> cacheFile <span style="color: #66cc66;">=</span> prefix .. hash .. <span style="color: #ff0000;">'.'</span> .. fileExtension
    <span style="color: #b1b100;">if</span> <span style="color: #b1b100;">not</span> file_info<span style="color: #66cc66;">&#40;</span>concatRoot .. cacheFile, <span style="color: #ff0000;">&quot;is_file&quot;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #b1b100;">then</span>
        <span style="color: #b1b100;">local</span> content <span style="color: #66cc66;">=</span> <span style="color: #ff0000;">&quot;&quot;</span>
        <span style="color: #b1b100;">for</span> file <span style="color: #b1b100;">in</span> <span style="color: #b1b100;">string</span>.gmatch<span style="color: #66cc66;">&#40;</span>match, <span style="color: #ff0000;">&quot;(.-<span style="color: #000099; font-weight: bold;">\.</span>&quot;</span> .. fileExtension .. <span style="color: #ff0000;">&quot;),?&quot;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #b1b100;">do</span>
            content <span style="color: #66cc66;">=</span> content .. <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>
            content <span style="color: #66cc66;">=</span> content .. <span style="color: #ff0000;">&quot;/**<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>
            content <span style="color: #66cc66;">=</span> content .. <span style="color: #ff0000;">&quot; *<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>
            content <span style="color: #66cc66;">=</span> content .. <span style="color: #ff0000;">&quot; *  &quot;</span> .. file .. <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>
            content <span style="color: #66cc66;">=</span> content .. <span style="color: #ff0000;">&quot; *<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>
            content <span style="color: #66cc66;">=</span> content .. <span style="color: #ff0000;">&quot; */<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>
            content <span style="color: #66cc66;">=</span> content .. <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>
            content <span style="color: #66cc66;">=</span> content .. read_file<span style="color: #66cc66;">&#40;</span>rootPath .. file<span style="color: #66cc66;">&#41;</span>
        <span style="color: #b1b100;">end</span>
        write_cache<span style="color: #66cc66;">&#40;</span>concatRoot .. cacheFile, content <span style="color: #66cc66;">&#41;</span>
    <span style="color: #b1b100;">end</span>
    lighty.env<span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">&quot;physical.path&quot;</span><span style="color: #66cc66;">&#93;</span> <span style="color: #66cc66;">=</span> concatRoot .. cacheFile
<span style="color: #b1b100;">end</span>
&nbsp;
<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">not</span> file_info<span style="color: #66cc66;">&#40;</span>lighty.env<span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">&quot;physical.path&quot;</span><span style="color: #66cc66;">&#93;</span>, <span style="color: #ff0000;">&quot;is_file&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #b1b100;">then</span>
    css <span style="color: #66cc66;">=</span> <span style="color: #b1b100;">string</span>.match<span style="color: #66cc66;">&#40;</span>lighty.env<span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">&quot;physical.path&quot;</span><span style="color: #66cc66;">&#93;</span>, <span style="color: #ff0000;">&quot;css/(.*<span style="color: #000099; font-weight: bold;">\.</span>css)&quot;</span><span style="color: #66cc66;">&#41;</span>
	<span style="color: #b1b100;">if</span> css <span style="color: #b1b100;">then</span>
        <span style="color: #b1b100;">return</span> combine_files<span style="color: #66cc66;">&#40;</span>lighty, css, <span style="color: #ff0000;">&quot;css&quot;</span><span style="color: #66cc66;">&#41;</span>
    <span style="color: #b1b100;">end</span>
&nbsp;
    js <span style="color: #66cc66;">=</span> <span style="color: #b1b100;">string</span>.match<span style="color: #66cc66;">&#40;</span>lighty.env<span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">&quot;physical.path&quot;</span><span style="color: #66cc66;">&#93;</span>, <span style="color: #ff0000;">&quot;js/(.*<span style="color: #000099; font-weight: bold;">\.</span>js)&quot;</span><span style="color: #66cc66;">&#41;</span>	    
	<span style="color: #b1b100;">if</span> js <span style="color: #b1b100;">then</span>
        <span style="color: #b1b100;">return</span> combine_files<span style="color: #66cc66;">&#40;</span>lighty, js, <span style="color: #ff0000;">&quot;js&quot;</span><span style="color: #66cc66;">&#41;</span>
	<span style="color: #b1b100;">end</span> 
<span style="color: #b1b100;">end</span></pre></td></tr></table></div>


	Tags: <a href="http://www.cakephp.nu/t/english" title="english" rel="tag">english</a>, <a href="http://www.cakephp.nu/t/lighttpd" title="lighttpd" rel="tag">lighttpd</a>, <a href="http://www.cakephp.nu/t/lua" title="lua" rel="tag">lua</a>, <a href="http://www.cakephp.nu/t/mod_magnet" title="mod_magnet" rel="tag">mod_magnet</a><br />
]]></content:encoded>
			<wfw:commentRss>http://www.cakephp.nu/faster-page-loads-bundle-your-css-and-javascript-lighttpd-mod_magnet-lua/feed</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
	</channel>
</rss>
