The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
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!!! |
#2
|
|||
|
|||
Hi,
try setting following PHP code at the top of all PHP sites, whom you want to have GZ compression activated: PHP Code:
whizkid |
#3
|
|||
|
|||
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. |
#4
|
||||
|
||||
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. |
#5
|
|||
|
|||
the code would have to be before any information was sent to the browser
|
#6
|
|||
|
|||
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:
|
#7
|
||||
|
||||
]
Quote:
If it's in templates, can I just set it in the header? |
#8
|
|||
|
|||
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.
|
#9
|
||||
|
||||
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? |
#10
|
||||
|
||||
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.
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|