We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 42101
    • 125 Posts
    Hi!

    I am trying to get gzip working.
    I put in:



    # compress text, html, php, javascript, css, xml:
    AddOutputFilterByType DEFLATE text/javascript
    AddOutputFilterByType DEFLATE text/plain
    AddOutputFilterByType DEFLATE text/html
    AddOutputFilterByType DEFLATE text/xml
    AddOutputFilterByType DEFLATE text/css
    AddOutputFilterByType DEFLATE application/xml
    AddOutputFilterByType DEFLATE application/xhtml+xml
    AddOutputFilterByType DEFLATE application/rss+xml
    AddOutputFilterByType DEFLATE application/javascript
    AddOutputFilterByType DEFLATE application/x-javascript
    AddOutputFilterByType DEFLATE application/x-httpd-php
    AddOutputFilterByType DEFLATE application/x-httpd-fastphp
    AddOutputFilterByType DEFLATE image/svg+xml
     
    # Drop problematic browsers
    BrowserMatch ^Mozilla/4 gzip-only-text/html
    BrowserMatch ^Mozilla/4\.0[678] no-gzip
    BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
     
    # Make sure proxies don't deliver the wrong content
    Header append Vary User-Agent env=!dont-vary


    to activate it via htaccess, but when I check my page on e.g. http://www.testthisurl.com/index.php
    it says compression is not activated. Is there an option in revos settings?

    thank you!

    AD

    edit:

    I put
    output_handler = ob_gzhandler
    into my php.ini - and now it works. [ed. note: ad2003 last edited this post 13 years, 5 months ago.]
      • 1343 ☆ A M B ☆
      • 2,213 Posts
      I'm glad you found the solution for you host. The .htaccess commands will only work if your host has apache configured with the correct modules.

      You could try using the code from here: http://salscode.com/web-resources/gzip-htaccess

      If you don't mind sharing who is your host should anyone else try to accomplish the same goal?
        Patrick | Server Wrangler
        About Me: Website | Tweets |  MODX Hosting
        • 43488
        • 5 Posts
        I have not used mod_gzip but here is my .htaccess I use to gzip .js, .css and other files via mod_deflate:

        #Gzip
        <ifmodule mod_deflate.c>
        AddOutputFilterByType DEFLATE text/text text/html text/plain text/xml text/css application/x- javascript application/javascript
        </ifmodule>
        #End Gzip

        In case you are not already aware of it, Firebug is very useful for checking if downloaded content is gzipped. Click on the "Net" tab in Firebug and then do shift-f5 to get Firefox to reload all the .js and .css files so they show in the Net panel. Click the "+" next to the .js or .css file and click the "Headers" tab. If the response is gzipped you will see "Content-Encoding gzip" in the Response Headers section. I image the IE, Safari, and Chrome equivalents offer the same ability.


        here is a syntax to use with file extensions, easy as pie...

        <IFModule mod_deflate.c>
        <filesmatch "\.(js|css|html|jpg|png|php)$">
        SetOutputFilter DEFLATE
        </filesmatch>
        </IFModule>

          • 42101
          • 125 Posts
          Quote from: AMDbuilder at Apr 25, 2013, 07:01 PM
          I'm glad you found the solution for you host. The .htaccess commands will only work if your host has

          If you don't mind sharing who is your host should anyone else try to accomplish the same goal?
          #

          sure!

          I am at strato.de - that's no hoster I would recommend...Makes problems from the first hour using modx...

          I found this on the strato website:

          mod_gzip_on Yes


          add it to htaccess and gzip works... at strato hoster..

          AD
            • 42101
            • 125 Posts
            Quote from: leelondon at Apr 28, 2013, 02:53 PM
            I have not used mod_gzip but here is my .htaccess I use to gzip .js, .css and other files via mod_deflate:

            #Gzip
            <ifmodule mod_deflate.c="">
            AddOutputFilterByType DEFLATE text/text text/html text/plain text/xml text/css application/x- javascript application/javascript
            </ifmodule>
            #End Gzip

            In case you are not already aware of it, Firebug is very useful for checking if downloaded content is gzipped. Click on the "Net" tab in Firebug and then do shift-f5 to get Firefox to reload all the .js and .css files so they show in the Net panel. Click the "+" next to the .js or .css file and click the "Headers" tab. If the response is gzipped you will see "Content-Encoding gzip" in the Response Headers section. I image the IE, Safari, and Chrome equivalents offer the same ability.


            here is a syntax to use with file extensions, easy as pie...

            <ifmodule mod_deflate.c="">
            <filesmatch "\.(js|css|html|jpg|png|php)$"="">
            SetOutputFilter DEFLATE
            </filesmatch>
            </ifmodule>


            thanks for sharing!
            didn't know the tip in Firebug... smiley

            AD