1. Please take a little time for this simple survey! Thank you for participating!
    Dismiss Notice
  2. Dear Pleskians, please read this carefully! New attachments and other rules Thank you!
    Dismiss Notice
  3. Dear Pleskians, I really hope that you will share your opinion in this Special topic for chatter about Plesk in the Clouds. Thank you!
    Dismiss Notice

Plesk 11 deflate CSS / JS

Discussion in 'Plesk 11.x for Linux' started by 36above, Aug 19, 2012.

  1. 36above

    36above Guest

    0
     
    Hi all,

    I have done extensive searching before posting here but have not turned up a working answer.

    I have been trying to enable server-wide compression using deflate.

    My server is running a fresh install of plesk panel 11 installed over a fresh centos 6 64. The configs and settings (aside from files I mention) have not been changed at all from default.

    I have created a new file in /etc/httpf/conf.d/deflate.conf This file is being included when Apache is restarted, so that's definitely working and the html doc compresses.

    But not matter what I do (I have tried every combination Google would help me find) css and js files will not compress. At my previous workplace we also used a Plesk server and nobody could ever get compression working there either.

    Don't suppose anyone on the forums has actually done it with Plesk 11 and would be kind enough to clue me in on how they managed it?
     
  2. abdi

    abdi Platinum Pleskian

    31
    18%
    Joined:
    May 14, 2006
    Messages:
    2,913
    Likes Received:
    60
  3. Acidvetigo

    Acidvetigo New Pleskian

    6
     
    Joined:
    May 5, 2013
    Messages:
    1
    Likes Received:
    0
    Hello,
    I have the same problem with plesk 11. Only php files are gzipped. Css and js files are sent without gzip compression.
    I've tried to configure inside the httpd file and also with the deflate.conf file but unsuccessfully.
    Have you resolved this?
     
  4. thymus

    thymus New Pleskian

    11
    55%
    Joined:
    Jun 11, 2013
    Messages:
    1
    Likes Received:
    1
    adding the following to /etc/nginx/nginx.conf

    gzip on;
    gzip_disable "MSIE [1-6]\.(?!.*SV1)";

    gzip_types text/plain text/html text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript application/javascript text/x-js;


    This fixed the problem for me.
     
    JTRipper likes this.
  5. bileamara

    bileamara New Pleskian

    3
     
    Joined:
    Jun 27, 2014
    Messages:
    1
    Likes Received:
    0
    Hi,
    I've got the same problem.

    I add this lines to /etc/httpd/conf/httpd.conf
    Code:
      AddOutputFilterByType DEFLATE text/html text/xml text/css text/plain
      AddOutputFilterByType DEFLATE text/javascript application/javascript application/x-javascript application/json
    
        DeflateCompressionLevel 9
    
        # Netscape 4.x has some problems...
        BrowserMatch ^Mozilla/4 gzip-only-text/html
    
        # Netscape 4.06-4.08 have some more problems
        BrowserMatch ^Mozilla/4\.0[678] no-gzip
    
        # MSIE masquerades as Netscape, but it is fine
        BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
    
        # Don't compress images
        #SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
    
        # Make sure proxies don't deliver the wrong content
    
        Header append Vary User-Agent env=!dont-vary
    
    and create a new /etc/nginx/conf.d/gzip.conf with this code
    Code:
    gzip on;
    gzip_disable .MSIE [1-6]\.(?!.*SV1).;
    gzip_types text/plain [s]text/html[/s] text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript application/javascript text/x-js;
    


    css and js files are not compressed
     
Loading...