![]() |
gzip your CSS
Step 1
Create a new file, call it 'gzip-css.php' copy the following snippet and upload to the 'vbulletin_css' folder: PHP Code:
create a .htaccess file, put this in the same directory as above, put in the following snippet: PHP Code:
Open the adminfunctions_template.php file located in the 'includes' directory. Look for the following: PHP Code:
PHP Code:
|
FIRST POST
Awesomse idea man :banana: |
IMHO it would be easeir to just use mod_gzip ?
|
what's this for?
|
its for gzip'ing your CSS!
like gzip'ing up your coat when its chilly. ;) |
umm gzip css ?
confused... it should help to load the page faster ? mod_gzip ..its possible to use it in shared server? |
Hmm, I wouldn;'st suggest that, at least if I understand some things. I believe that IE has some issues cacheing gziped pages, and the CSS file should only be requested a few times before cached, thus why we have it as a file.
|
Thanks!
|
Quote:
this option allready in vb's acp. |
Quote:
|
hmm then no need to use this att all....
|
is it working at winodws servers?
|
is step 3 bakwards?
I had .css in there, not .php |
Good work..
But is there any increase in performance? |
Increase preformace would be removing gzip, decreasing preformance would be adding it back.
|
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 |
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. |
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.
|
All times are GMT. The time now is 05:49 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 | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|