Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: Gzip Problem

  1. #1
    Casual Pligger calvin199's Avatar
    Joined
    Mar 2010
    Posts
    34

    Gzip Problem

    Hi friends,

    i want to enable gzip on my site and i am having certain issues.
    This topic has been covered earlier and i have read all the posts but still not getting any definite answer.

    It would be kind if some of you can guide.

    Host: Godaddy
    Pligg version:1.0.3b
    php: php 5.3



    got my absolute server path using this code and also checked the absolute path from godaddy account ....
    <?php
    echo realpath(dirname(__FILE__));
    ?>

    changed the gzip section in .htaccess to following changing the /home/path/to to my absolute path
    php_value auto_prepend_file /home/path/to/begin_gzip.php
    php_value auto_append_file /home/path/to/end_gzip.php
    AddType "text/javascript" .gz
    AddEncoding gzip .gz
    RewriteCond %{HTTP:Accept-encoding} gzip
    RewriteCond %{THE_REQUEST} ^(.*).js
    RewriteCond %{SCRIPT_FILENAME}.gz -f
    RewriteRule ^(.*)\.js $1.js.gz [L]


    however the result is 500 internal server error... please tell me if i am missing something or i need to do in some other fashion...


    Thanks for your support.

  2. #2
    Casual Pligger calvin199's Avatar
    Joined
    Mar 2010
    Posts
    34
    sorry php version:5.2.8

  3. #3
    Pligg Developer chuckroast's Avatar
    Joined
    Jun 2006
    Posts
    5,478
    Googleing around it looks like a lot of people have problems with gzip and Godaddy.
    I'm not sure there is anything that you can do besides switch hosts to one that provides more of a standardized hosting environment.

  4. #4
    Casual Pligger calvin199's Avatar
    Joined
    Mar 2010
    Posts
    34
    Thanks for the quick reply chuckroast.

    have just sent a email to godaddy guys asking whether it is supported or not. should be getting a reply in an hour. Can you please look up this issue as i am sure many pligg owners are with godaddy and this is certainly a big issue with search engines giving greater preference to site loading times now.

    If any one can throw some light on this it would be very helpful

  5. #5
    Casual Pligger calvin199's Avatar
    Joined
    Mar 2010
    Posts
    34
    Another update:

    Just received the reply of my email to godaddy
    "We do not have any restrictions that would prevent you from using GZIP with Pligg installation on your hosting account."

    It would be kind for the developers to look into this issue and provide some hints as to how this thing can be accomplished.

    If any one has been able to get gzip compression on their sites with godaddy kindly tell the procedure.

    Any help on this issue would be great.

  6. #6
    Casual Pligger calvin199's Avatar
    Joined
    Mar 2010
    Posts
    34
    any help coming..
    Please developers kindly look this up.

  7. #7
    Pligg Developer chuckroast's Avatar
    Joined
    Jun 2006
    Posts
    5,478
    I don't have a godaddy account. I'm not going to be much help.

  8. #8
    Casual Pligger calvin199's Avatar
    Joined
    Mar 2010
    Posts
    34
    again thanks for quick reply... just now in my desperation and hit and trial was able to get to this point..

    Added this code in libs/html.php at the top:
    <?php if (substr_count($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip')) ob_start("ob_gzhandler"); else ob_start(); ?>


    Now using these two services :
    1.whatsmyip.org/http_compression/
    2.gidnetwork.com/tools/gzip-test.php

    i am getting that i have successfully gzipped all my pages
    however using pingdom tool i have checked with and without this code and the difference between the load time for a gzipped page and non gzipped page is almost zero.

    Am i doing something wrong?
    Do the changes necessarily have to be in .htaccess?
    Please guide how can this thing be properly done giving a good compression and low load time.

    Thanks for your time.

  9. #9
    Pligg Developer chuckroast's Avatar
    Joined
    Jun 2006
    Posts
    5,478
    Quote Originally Posted by calvin199 View Post
    again thanks for quick reply... just now in my desperation and hit and trial was able to get to this point..

    Added this code in libs/html.php at the top:
    <?php if (substr_count($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip')) ob_start("ob_gzhandler"); else ob_start(); ?>


    Now using these two services :
    1.whatsmyip.org/http_compression/
    2.gidnetwork.com/tools/gzip-test.php

    i am getting that i have successfully gzipped all my pages
    however using pingdom tool i have checked with and without this code and the difference between the load time for a gzipped page and non gzipped page is almost zero.

    Am i doing something wrong?
    Do the changes necessarily have to be in .htaccess?
    Please guide how can this thing be properly done giving a good compression and low load time.

    Thanks for your time.
    I use this in my .htaccess for compression and speed up loads. So far I've had very good results with it.

    Code:
    # php compression – use with caution
    <ifmodule mod_php4.c>
    php_value zlib.output_compression 16386
    </ifmodule>
    
    # BEGIN Compress text files
    <IfModule mod_deflate.c>
    <FilesMatch "\.(css|js|x?html?|php)$">
    SetOutputFilter DEFLATE
    </FilesMatch>
    </IfModule>
    # END Compress text files
    # BEGIN Expire headers
    <IfModule mod_expires.c>
    ExpiresActive On
    ExpiresDefault "access plus 1 seconds"
    ExpiresByType image/x-icon "access plus 2592000 seconds"
    ExpiresByType image/jpeg "access plus 2592000 seconds"
    ExpiresByType image/png "access plus 2592000 seconds"
    ExpiresByType image/gif "access plus 2592000 seconds"
    ExpiresByType application/x-shockwave-flash "access plus 2592000 seconds"
    ExpiresByType text/css "access plus 604800 seconds"
    ExpiresByType text/javascript "access plus 216000 seconds"
    ExpiresByType application/x-javascript "access plus 216000 seconds"
    ExpiresByType text/html "access plus 600 seconds"
    ExpiresByType application/xhtml+xml "access plus 600 seconds"
    </IfModule>
    # END Expire headers
    # BEGIN Cache-Control Headers
    <IfModule mod_headers.c>
    <FilesMatch "\\.(ico|jpe?g|png|gif|swf)$">
    Header set Cache-Control "max-age=2592000, public"
    </FilesMatch>
    <FilesMatch "\\.(css)$">
    Header set Cache-Control "max-age=604800, public"
    </FilesMatch>
    <FilesMatch "\\.(js)$">
    Header set Cache-Control "max-age=216000, private"
    </FilesMatch>
    <FilesMatch "\\.(x?html?|php)$">
    Header set Cache-Control "max-age=600, private, must-revalidate"
    </FilesMatch>
    </IfModule>
    # END Cache-Control Headers
    # BEGIN Turn ETags Off
    <IfModule mod_headers.c>
    Header unset ETag
    </IfModule>
    FileETag None
    # END Turn ETags Off
    # BEGIN Remove Last-Modified Header
    <IfModule mod_headers.c>
    Header unset Last-Modified
    </IfModule>
    # END Remove Last-Modified Header

  10. #10
    Pligg Developer chuckroast's Avatar
    Joined
    Jun 2006
    Posts
    5,478
    Another thing you can try if you are still trying to get the gzip thing to work is go though your pligg.tpl file in your template.

    Near the top where there are javascript calls.. add the following to them
    {if $enable_gzip_files eq 'true'}.gz{/if}

    So it would look like this

    filename.js
    would now look like
    filename.js{if $enable_gzip_files eq 'true'}.gz{/if}

    Hope that helps.

Page 1 of 2 12 LastLast

Similar Threads

  1. How to add gzip?
    By detronecis in forum Questions & Comments
    Replies: 0
    Last Post: 11-14-2010, 07:56 PM
  2. Replies: 9
    Last Post: 06-07-2010, 05:06 AM
  3. Problem enabling Gzip
    By ozo in forum Questions & Comments
    Replies: 6
    Last Post: 05-19-2007, 12:50 PM
  4. [Fixed] problem adding gzip code in htaccess
    By zearth in forum Questions & Comments
    Replies: 15
    Last Post: 02-12-2007, 05:27 AM
  5. GZip Using PHP?
    By vfaith in forum Questions & Comments
    Replies: 7
    Last Post: 01-07-2007, 08:12 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Pligg Modules and Pligg Templates from Pligg Pro Donate to Pligg CMS Dreamhost Web Hosting Host Gator Web Hosting