How can I enable GZIP compression in Jetty?

40

You have to enable the GzipFilter to make Jetty return compressed content. Have a look here on how to do that: http://blog.max.berger.name/2010/01/jetty-7-gzip-filter.html

You can also use the gzip init parameter to make Jetty search for compressed content. That means if the file file.txt is requested, Jetty will watch for a file named file.txt.gz and returns that.

Share:
40

Related videos on Youtube

azarudeen
Author by

azarudeen

Updated on September 18, 2022

Comments

  • azarudeen
    azarudeen almost 2 years

    i need to redirect my old url to new url structure

    old is http://website.com/mp3/song-name/

    new is http://website.com/song-name-mp3-download.html

    How can I do this using mod_rewrite?

    <IfModule mod_rewrite.c>
        RewriteEngine on
    
        RewriteRule ^play/(\d+)/.*$ playlist.php?action=shareview&id=$1
    
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteCond %{REQUEST_FILENAME} !-d
        RewriteRule ^(.*)$ search.php?search=$1 [L]
    
        RewriteRule 404.html 404.php
    
         RewriteEngine on
         RewriteCond $1 [A-Z]
         RewriteRule ^/?(.*)$ /${lowercase:$1} [R=301,L]
    
        <IfModule mod_deflate.c>
        <FilesMatch "\.(php|js|css|mp3|wmv|flv|html|htm)$">
            SetOutputFilter DEFLATE
        </FilesMatch>
    </IfModule>
        ErrorDocument 404 /mp3/404.html
    </IfModule>
    
  • tamberg
    tamberg almost 10 years
  • anubhava
    anubhava over 9 years
    Are there more rules in this .htaccess? What URL did you try?
  • azarudeen
    azarudeen over 9 years
    this is my current file
  • anubhava
    anubhava over 9 years
    Ah not in comments (it is unreadable), please edit your question and provide it there.
  • anubhava
    anubhava over 9 years
    ok in your htaccess insert this rule just below RewriteEngine on line.
  • azarudeen
    azarudeen over 9 years
  • azarudeen
    azarudeen over 9 years
    can you please suggest how to convert uppercase to lowercase in httpd.conf file
  • azarudeen
    azarudeen over 9 years
    is there any option without using htaccess
  • anubhava
    anubhava over 9 years
    You can do this in PHP also.
  • anubhava
    anubhava over 9 years
    Yes lowercase needs to be defined using RewriteMap. Also please don't change the question at this stage. If you run into problems don't hesitate to open a new question.
  • azarudeen
    azarudeen over 9 years
  • Janaka Bandara
    Janaka Bandara over 6 years
    The XML configuration could be added to WEB-INF/jetty-env.xml of the webapp (there are other options as well, jetty-web.xml, web-jetty.xml, classes/org/eclipse/jetty/webapp/webdefault.xml,...)