Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.5 > vBulletin 3.5 Add-ons

Reply
 
Thread Tools
gzip your CSS Details »»
gzip your CSS
Version: 1.00, by hidjra hidjra is offline
Developer Last Online: Apr 2020 Show Printable Version Email this Page

Version: 3.5.4 Rating:
Released: 03-16-2006 Last Update: Never Installs: 2
 
No support by the author.

Step 1
Create a new file, call it 'gzip-css.php' copy the following snippet and upload to the 'vbulletin_css' folder:

PHP Code:
<?php
ob_start
('ob_gzhandler');
header('Content-type: text/css; charset: UTF-8');
header('Cache-Control: must-revalidate');
header('Expires: Thu, 3 Jan 2007 23:53:18 GMT');
?>
Step 2
create a .htaccess file, put this in the same directory as above, put in the following snippet:

PHP Code:
php_value auto_prepend_file gzip-css.php 
Step 3
Open the adminfunctions_template.php file located in the 'includes' directory. Look for the following:

PHP Code:
$cssfilename 'clientscript/vbulletin_css/style-' substr(md5(microtime()), 88) . '-' str_pad($styleid5'0'STR_PAD_LEFT) . '.php'
change it to

PHP Code:
$cssfilename 'clientscript/vbulletin_css/style-' substr(md5(microtime()), 88) . '-' str_pad($styleid5'0'STR_PAD_LEFT) . '.css'
Now login to you vb control panel, re-generate the css file and your done. Enjoy

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #12  
Old 03-19-2006, 06:48 AM
Zia's Avatar
Zia Zia is offline
 
Join Date: Dec 2005
Location: golpo.net
Posts: 931
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

hmm then no need to use this att all....
Reply With Quote
  #13  
Old 03-20-2006, 11:04 PM
HeRCuL70 HeRCuL70 is offline
 
Join Date: Sep 2005
Posts: 17
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

is it working at winodws servers?
Reply With Quote
  #14  
Old 04-24-2006, 06:16 AM
briansol's Avatar
briansol briansol is offline
 
Join Date: Apr 2006
Location: CT
Posts: 254
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

is step 3 bakwards?

I had .css in there, not .php
Reply With Quote
  #15  
Old 04-24-2006, 06:45 AM
Hemanth's Avatar
Hemanth Hemanth is offline
 
Join Date: Nov 2005
Posts: 83
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Good work..

But is there any increase in performance?
Reply With Quote
  #16  
Old 04-24-2006, 07:30 AM
Zachery's Avatar
Zachery Zachery is offline
 
Join Date: Jul 2002
Location: Ontario, Canada
Posts: 11,440
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Increase preformace would be removing gzip, decreasing preformance would be adding it back.
Reply With Quote
  #17  
Old 05-07-2006, 02:09 AM
El-Gazaly El-Gazaly is offline
 
Join Date: Apr 2006
Posts: 20
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This code
$cssfilename = 'clientscript/vbulletin_css/style-' . substr(md5(microtime()), 8, 8) . '-' . str_pad($styleid, 5, '0', STR_PAD_LEFT) . '.css';
is in file alreadey
and iam not editing it before
Reply With Quote
  #18  
Old 05-07-2006, 03:43 AM
Code Monkey's Avatar
Code Monkey Code Monkey is offline
 
Join Date: May 2004
Posts: 1,080
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This is pointless since browsers cache all css and javascript when they are seperate files. It IS why you should always have them in a seperate file. Most webservers are running mod_deflate or equivilents that compress text in a way that browser can interpret. Browsers check and compare the time and date of last update for css and javascript files before downloading. So unless you have changed the css file, they will not be downloading the css in the first place.

But, do as you please.
Reply With Quote
  #19  
Old 06-14-2006, 08:03 PM
ShiningArcanine ShiningArcanine is offline
 
Join Date: May 2003
Posts: 105
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Personally, I think gzipping css files will not add as much bandwidth savings as gzipping .php files would but more bandwidth savings and faster initial page loads make doing something like this worth it.
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 03:52 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.14948 seconds
  • Memory Usage 2,283KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (4)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (9)post_thanks_box
  • (9)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (9)post_thanks_postbit_info
  • (8)postbit
  • (9)postbit_onlinestatus
  • (9)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete