![]() |
![]() |
![]() |
||||
Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us. |
![]() ![]() |
|
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
Thread Tools |
![]() |
#1 |
Confirmed User
Industry Role:
Join Date: Jun 2006
Location: Over there.
Posts: 817
|
Compressing CSS - any CSS experts out there?
I came across a tool that will compress your CSS file. Never heard of this before. A normal compression reduces the size (of my file) by 16% with the one I tested it with.
Not being a CSS expert, I have to ask those who are, is this safe to do or a good idea? This is the site: http://www.cssdrive.com/index.php/main/csscompressor/
__________________
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#2 |
In the Cave of Gold
Industry Role:
Join Date: Jun 2010
Location: ONLINE
Posts: 660
|
It's safe but unless your css file is huge, and your traffic is huge, kind of pointless. You're talking about compressing a 5kb file down to 4kb which I guess could make a difference if you have 2 million uniques a day
![]() The drawback is that it strips all the white space and makes it difficult to edit in the future by making it difficult to read.
__________________
![]() |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#3 |
Confirmed User
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 |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#4 |
Confirmed User
Industry Role:
Join Date: Jun 2006
Location: Over there.
Posts: 817
|
Thanks. My head just exploded. :-)
I'll spend some time on this then and see what I can come up with.
__________________
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#5 |
Too lazy to set a custom title
Industry Role:
Join Date: Aug 2002
Posts: 55,359
|
make sure to keep a copy of your original if you minify it so you can edit later
__________________
Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence. ![]() WP Stuff |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#6 |
Confirmed User
Industry Role:
Join Date: Jun 2008
Location: Finland
Posts: 1,588
|
From a designers point of view - compress if you really need to, but as Fris said, keep a copy of the original if there's a chance that you or somebody else is going to make any edits later on.
If I receive a compressed CSS file, I just quickly re-format it with an online tool such as http://www.lonniebest.com/FormatCSS/, so removing spaces etc. isn't a problem but it's a real pain when you have a massive CSS file and absolutely no comments ![]() So if you're lucky enough to have a commented CSS file, keep a copy of it ![]()
__________________
www.gimme-website.com |
![]() |
![]() ![]() ![]() ![]() ![]() |