View Single Post
Old 07-20-2010, 03:01 AM  
BestXXXPorn
Confirmed User
 
BestXXXPorn's Avatar
 
Join Date: Jun 2009
Location: Asheville, NC
Posts: 2,277
Absolutely you should minify your css files... I would recommend creating a deployment script that does this for you whenever you deploy site changes.

I use one which minifies all JS and CSS and then gzips everything. I then serve the minified and compressed files so the web server doesn't have to handle compression on every request...

What I've done, personally, is simply add "z" to the end of the file that way both the unminified/uncompressed version and the min/compressed versions reside on the server. Your templates can then have something similar to:


<link rel="stylesheet" href="/styles/common.css<? if (!$dev) echo 'z'; ?>?r=1234" type="text/css">

So your development deployments will use the standard .css file and production boxes will serve up the .cssz (minified and compressed) version...

The r=1234 tacked onto the end there is for versioning... that way if you need to roll additional CSS changes and want to make sure that all users browsing the site update to the new CSS file immediately on the next request, you can just increment the revision number ;)
__________________
ICQ: 258-202-811 | Email: eric{at}bestxxxporn.com

Last edited by BestXXXPorn; 07-20-2010 at 03:03 AM..
BestXXXPorn is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote