How To: Optimize Your CSS Even More

Register an Account
Pligg Chat Room
Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 03-23-2007, 06:59 PM
Constant Pligger
 
Join Date: Apr 2006
Location: USA
Posts: 351
A nice article I found about speeding up the css part of your site. I figured this could be applied to pligg as well in our search for a faster pligg site.

uses php and zlib.

http://paulstamatiou.com/2007/03/18/...css-even-more/
Reply With Quote
  #2 (permalink)  
Old 03-23-2007, 07:42 PM
Constant Pligger
 
Join Date: Mar 2006
Posts: 537
Yep, a very good tip, and works well for javascript files too. The real benefits of compression come from compressing these type of files in my opinion, not simply the html.

If you have a large number of js / css files in a directory and don't want to change them all (ie. feeling lazy ), you can add 2 files to the directory that will do the job for you (needs htaccess access and zlib enabled):

.htaccess
Code:
AddHandler application/x-httpd-php .css
php_value auto_prepend_file css.php
php_flag zlib.output_compression On
css.php
Code:
<?php 
header("Content-type: text/css; charset: UTF-8");
header("Cache-Control: must-revalidate");
header("Expires: " . gmdate("D, d M Y H:i:s", time() + 3600) . " GMT");
?>
You can change css to js to get the same results with javascript files.
Reply With Quote
  #3 (permalink)  
Old 03-23-2007, 08:50 PM
kbeeveer46's Avatar
Pligg Developer/Admin
Pligg Version: 0
Pligg Template: none
 
Join Date: Jun 2006
Location: Muncie, Indiana
Posts: 3,215
You can speed up your Pligg site dramatically by gzipping your CSS file. It almost cut the loading time in half when I did testing with it.
Reply With Quote
  #4 (permalink)  
Old 03-23-2007, 10:25 PM
Constant Pligger
 
Join Date: Apr 2006
Location: USA
Posts: 351
can we expect to see these things in the next release?
Reply With Quote
  #5 (permalink)  
Old 10-09-2007, 02:55 PM
New Pligger
 
Join Date: Sep 2007
Posts: 15
Hi all, i've been searching for optimizing js and css, i thought this links could be useful if anyone tries to optimize.
WP css OptimizerThis one is a plugin of wordpress to optimize the js in one file and the css in other
rakaz combine.phpAnd this one is a standalone php script to combine js and css.
I have no skills programming so i haven't implemmented yet to my site, but i think it can be useful
Reply With Quote
  #6 (permalink)  
Old 01-24-2008, 10:44 AM
Banned
Pligg Version: 9.8.
Pligg Template: Custom
 
Join Date: Feb 2007
Location: Canada
Posts: 796
Robson » CSS Compressor seems to be the most reliable CSS compressor.

And Dojo ShrinkSafe -- the safe way to make your JS sprightly seems to be a very good Javascript compressor. It took thickbox from 11kb to 7kb for me.

Geoserv
Reply With Quote
  #7 (permalink)  
Old 01-27-2008, 04:33 PM
Divisive Cotton's Avatar
Pligg Donor
 
Join Date: Sep 2007
Posts: 197
I tried Dojo and it didn't make any difference in the size of the file for me...

Did you click on the 'strip newline chars?' box?

I wouldn't use one of the automatic CSS compressors - it's best to do it manually, although the PHP trick as listed above works well....
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Optimize tags table in MySql clems365 Questions and Comments 7 06-02-2008 05:22 PM
Optimize your pligg site for better SEO with these tutorial instructions pliggedit Questions and Comments 11 03-06-2008 01:39 PM


Pligg Modules and Pligg Templates from Pligg Pro Find support on the Pligg CMS Forum - 24 hours a day! Make a donation to support Pligg CMS development