Results 1 to 7 of 7

Thread: Enable Gzip in vshare

  1. #1

    Default Enable Gzip in vshare

    Had a few peaple ask how to enable gzip so i thought i would add it here.

    Edit view_video.php

    on line 1 after ""<?php"" add:

    Code:
     if (substr_count($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip')) ob_start("ob_gzhandler"); else ob_start();
    Do this on whatever pages gets a lot of hits (ie index.php user.php) or all if you wish.

    Here is a quick example why it is useful :

    Code:
    Results for: http://think-porn.com/think1/view/1358/ethiopian-black-amateur-rides-big-dick-on-hidden-camera/
    Web page compressed?	Yes
    Compression type?	gzip
    Size, Markup (bytes)	57,869
    Size, Compressed (bytes)	9,052
    Compression %	84.4
    Code:
    Results for: http://sexxxyurl.com/view/16/funny_sexy_cartoons/
    Web page compressed?	No
    Compression type?	none
    Size, Markup (bytes)	28,158
    Size, Compressed (bytes)	0
    Compression %	0.0
    
    
    What if http://sexxxyurl.com/view/16/funny_sexy_cartoons/ was compressed / gzip encoded?
    
    GZIP Compression Level	Size, Compressed (bytes)	Compression %	Download (seconds)
    0	28,158	0.0	?.??
    1	6,250 	77.8	?.??
    2	6,081   	78.4	?.??
    3	5,924 	79.0	?.??
    4	5,599 	80.1	?.??
    5	5,461 	80.6	?.??
    6	5,402 	80.8	?.??
    7	5,380 	80.9	?.??
    8	5,347 	81.0	?.??
    9	5,341 	81.0	?.??
    Gl for all who did not know how to greatly speed up there sites with this.

    Dont know if your page is already Gzip'd?

    Test it here > GIDZipTest: Web Page Compression (Deflate / Gzip) Test - GIDNetwork

  2. #2

    Default

    Quote Originally Posted by Parkins121 View Post
    Thanks for sharing.
    Not a problem

    even if it comes in handy for one person it was worth posting :)

  3. #3
    Join Date
    Sep 2008
    Posts
    1,019

    Default

    Enabling gzip is actually not a good idea for a video site (same goes for mod-deflate). It leads to problems loading some of the videos. It is the reason why vShare disables gzip in the .htaccess file.
    vShare Solutions
    Custom vShare Modules and Services

    Now, your visitors can watch videos on your site using their mobile or tablet device with the Mobility Mod for vShare 2.8!

  4. #4

    Default

    Quote Originally Posted by bplex View Post
    Enabling gzip is actually not a good idea for a video site (same goes for mod-deflate). It leads to problems loading some of the videos. It is the reason why vShare disables gzip in the .htaccess file.
    Well since i have had gzip on my site i have had zero complaints but plenty of users who think the site is very fast compaired to some others.

    if not one complaint from over half a million visiters then i think it is worth enabling dont you?

  5. #5
    Join Date
    Sep 2008
    Posts
    1,019

    Default

    No. Your statement falls into the same category as me stating the following:

    "My hand is hurting. So, to solve my hand hurting problem, I'm going to cut of my hand!"

    Sure, cutting of my hand would solve the problem of it hurting. But, by doing that, I no longer have that hand. This is exactly what happens when you enable gzip compression on a tube site.

    Why enabling gzip works for you:

    The reason why your site works faster is because of what gzip does, as you already know. By compressing your files before you send them to the end-user, pages will load faster because a smaller file is sent to the browser (instead of you sending a page that is 200KB in size, for example, you may only send a page that is 10KB in size). Likewise, because you are sending smaller files, your site consumes less bandwidth and, as a result, you site can consume more visitors in a given period of time (usually by a factor equal to your compression so if you are able to compress your site by 50%, you can have double the amount of visitors to your site). For just about everything but flash, this is a great thing to do. For flash, however, this is not.

    Why enabling gzip is bad for a flash site:

    Enabling gzip has some tremendous adverse effects when enabled on a site that is utilizing flash. I'll list the top three in the order of importance (there are a ton more, but these are the most important ones):

    The biggest problem is actually a new problem that now happens if your users are using Flash 10.1. Flash 10.1 added a much sought after new feature to flash... hardware acceleration. This essentially allows for flash files, especially H.264 encoded ones, to be decoded in hardware rather than in the CPU. The problem that gets introduced with gzip is that whenever you gzip a flash file, you essentially double-compress the file. Likewise, it has to be double-decompressed. Because the file gets compressed into a format outside of flash, you loose all benefits of hardware acceleration. Further, since the file has to be decompressed twice (one for gzip, the other for flash), you actually make your user's computer perform twice the amount of work. The end result is that while your site loads faster for most, it also requires their computers to work harder to do it and that leads to many more flash plugin crashes.

    The second biggest problem (used to be the biggest before Flash 10.1) is in browser compatibility issues. Browsers such as Firefox and Safari behave abnormally at times whenever you gzip flash content. The most common problem in Firefox is that you get the "white flash screen" while the most common problem you get in Safari (and, really, any webkit based browser, including Chrome) is that your flash player's controls stop working (or work incorrectly). IE is a whole different animal. Problems in IE can range from the video not playing at all to your video playing the wrong file altogether (because of caching). These problems all can vary depending on the browser version and their OS so different people can experience different behaviors.

    The third biggest problem is that because you are double compressing the flash files, your server load will increase. This is because your server has to recompress the files on the fly and send it to your end-users. Now, the same thing happens with images too, but because images are smaller than video files, the server load increase is negligible. For videos, though, it is significant.

    So, yes, enabling gzip has its benefits. But, the costs of doing that are also significant. The biggest thing is that you are saying that your end users are not complaining. Well, that may be true for your visitors. Most of these problems usually are ignored or get resolved by simply refreshing the page a few times (many people will refresh the page thinking that something is up with their computer and, when it works correctly after the refresh, they don't worry about it). And, to be honest, most of the benefits are only going to be experienced on sites that generate a large amount of traffic (such as yours, in this case) as by doing that, you solve the problem without really addressing what the problem actually is... which is lack of available bandwidth. It's also a cheaper solution because fixing the actual problem is expensive. So, I'll leave it with this. As I said before, enabling gzip on a flash site is not a good idea. It can lead to problems. If you want to do it, that's your business. It will make your site faster (in some cases). But, it's not a good thing to do on a flash site.

    BTW, you can find out more of the problems by googling "gzip flash problems" or "gzip flv problems". You can also find out the issues that are experienced with SWF compression with gzip by googling "gzip swf problems".
    vShare Solutions
    Custom vShare Modules and Services

    Now, your visitors can watch videos on your site using their mobile or tablet device with the Mobility Mod for vShare 2.8!

  6. #6
    Join Date
    Jan 2008
    Posts
    216

    Default

    I think that the solution stays in the middle, it is possible to activate gzip in all pages except on view_video.php that is the only page in which there is the flash player. ;-)

  7. #7
    Join Date
    Oct 2010
    Posts
    29

    Default

    You can use Apache Mod_Deflate without problems
    More info here :
    Apache Mod_Deflate and Flash SWF Files Don't Like Each Other | Phil Chen

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •