![]() |
gzip compression: howto
Greetings,
I have vbulletin running, of course, with gzip compression enabled. Since my connection is reasonably fast, I hardly notice a significant difference between php pages that are compressed (the forum) and those that aren't (the rest of the site). But today traffic was soaring and the site was slooow, whereas the forum was ok. What I'm wondering is how can I set all the other php pages to use the compression, I assume it shouldn't be a problem since everything needed is already there, used by the forum. How can I "turn it on" for the rest of the site? Let me know if you need any specific info. Any help much appreciated!!! |
Hi,
try setting following PHP code at the top of all PHP sites, whom you want to have GZ compression activated: PHP Code:
whizkid |
The site could have been slow due to the extra cpu time required to compress the content before sending it to the client.
The gzip compression is designed to reduce bandwidth which will reduce loading time for most people, less time to download page = faster loading. I have noticed that with alot of users on all wanting gzipped pages that the server load jumps up a great deal. |
whizkid, that's all it takes? Does that mean it uses the same settings (ie. compression level) as I have set for the forum?
And how do I check whether the compression is on or off, whether it's working or not? Finally, does the code have to be the first line of code in the file, ie. before the html code starts? Or doesn't it matter where it is? PPN, I am aware of that, but in this case I had in mind the compression. My site is on a large server with a lot more sites so the difference in load should not be spectacular. Moreover, I am quite convinced it was a question of bandwidth this time. |
the code would have to be before any information was sent to the browser
|
Hi,
well it works for me ;). You could check by loadeing a page without the compression activated and then with the compression activated and see if it makes a difference. I put my code before any output to the browser happens. whizkid Quote:
|
]
Quote:
If it's in templates, can I just set it in the header? |
as long as you set it in a php file that is called on every page, i have a header.php file which is called on every page on my site, so you could just add it to that and as long as the script includes header.php it will run it.
|
It's not working. :( I copied one of your page that I assume are outside the forum and using the code you posted: http://www.php4-forum.com/php_tutorials/.
I made two versions, one with only the php code and the html and another with <? ob_end_flush() ?> at the very end. None of them work, I can't seem to load them in any of the browsers I've tried with. Have a look: http://www.juventuz.com/home/gzip/ When I try to load either one, IE gives me a dns error. What do you think the problem is? |
By the way, gzip will NOT compress images -- only text. So if the rest of your site has images galore, that could explain why you aren't seeing an improvement on the rest of your site.
|
Right now that is irrelevant because it's not working at all. *HELP*
But good point nonetheless, I am aware of that, however. |
Be ideal to be able to set this on for certain user groups - I want a hack to allow VB GZIP for moderators but NOT for ordinary users (as the CPU load is too high) - anyone help?
|
Ok.. I would love some help on this. I run vbPortal.. Ok no big deal, but the front page is not gzip enabled.
So I figure to make it gzip enabled you put the ob_start("ob_gzhandler"); at the beginning of the index.php and ob_clean_end(); at the end of the index.php file.. Right? Well, it just gives me a totally blank page. Any thoughts on this? yes, I could post over at vbPortal, but I think it's more of an "any external page to vBulletin" kind of answer correct? Thanks for all the help Josh |
^^ bump
thanks Josh |
Quote:
Is there a way we can tell is our host support gzip or not? :glasses: |
All times are GMT. The time now is 12:16 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:
|