Changeset 8243b69 for installer


Ignore:
Timestamp:
Jan 20, 2016 10:40:11 PM (5 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
179a4a2
Parents:
2007e88
Message:

Jetty: Add gzip filter to eepsite Jetty (new installs only)

Location:
installer/resources/eepsite/contexts
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • installer/resources/eepsite/contexts/base-context.xml

    r2007e88 r8243b69  
    3838    <Arg>/</Arg>
    3939  </Call>
     40  <Call name="addServlet">
     41    <Arg>org.eclipse.jetty.servlet.DefaultServlet</Arg>
     42    <Arg>/</Arg>
     43  </Call>
     44  <Call name="addFilter">
     45    <!-- Add a filter to gzip on-the fly, since if we don't do it, I2P will.
     46      -  This lowers the resource usage in the Java process on the client side,
     47      -  by pushing the decompression out of Java and into the browser.
     48      -  For all the reasons noted in the GzipFilter javadocs, this is normally
     49      -  a bad idea for static content, but this is I2P.
     50      -  See I2PTunnelHTTPServer for the I2P compressor.
     51      -->
     52    <Arg>
     53      <New class="org.eclipse.jetty.servlet.FilterHolder" >
     54        <Arg>
     55          <New class="org.eclipse.jetty.servlets.GzipFilter" />
     56        </Arg>
     57        <Call name="setInitParameter">
     58          <!-- minimum in Java is 1300 -->
     59          <Arg>minGzipSize</Arg>
     60          <Arg>512</Arg>
     61        </Call>
     62        <Call name="setInitParameter">
     63          <!-- In Java we have a blacklist. This covers the most common cases. -->
     64          <Arg>mimeTypes</Arg>
     65          <Arg>application/pdf,application/x-javascript,application/xhtml+xml,application/xml,image/svg+xml,text/css,text/html,text/plain</Arg>
     66        </Call>
     67      </New>
     68    </Arg>
     69    <Arg>/*</Arg>
     70    <Arg>
     71      <!-- just guessing here -->
     72      <Call class="java.util.EnumSet" name="of" >
     73        <Arg>
     74          <Call class="javax.servlet.DispatcherType" name="valueOf" >
     75            <Arg>REQUEST</Arg>
     76          </Call>
     77        </Arg>
     78      </Call>
     79    </Arg>
     80  </Call>
    4081</Configure>
    4182
  • installer/resources/eepsite/contexts/cgi-context.xml

    r2007e88 r8243b69  
    3434    <Arg>/</Arg>
    3535  </Call>
     36  <Call name="addFilter">
     37    <!-- See base-context.xml for info.
     38         Unlike for DefaultServlet, there's not even a theoretical
     39         inefficiency for using this.
     40      -->
     41    <Arg>
     42      <New class="org.eclipse.jetty.servlet.FilterHolder" >
     43        <Arg>
     44          <New class="org.eclipse.jetty.servlets.GzipFilter" />
     45        </Arg>
     46        <Call name="setInitParameter">
     47          <Arg>minGzipSize</Arg>
     48          <Arg>512</Arg>
     49        </Call>
     50        <Call name="setInitParameter">
     51          <Arg>mimeTypes</Arg>
     52          <Arg>application/pdf,application/x-javascript,application/xhtml+xml,application/xml,image/svg+xml,text/css,text/html,text/plain</Arg>
     53        </Call>
     54      </New>
     55    </Arg>
     56    <Arg>/*</Arg>
     57    <Arg>
     58      <Call class="java.util.EnumSet" name="of" >
     59        <Arg>
     60          <Call class="javax.servlet.DispatcherType" name="valueOf" >
     61            <Arg>REQUEST</Arg>
     62          </Call>
     63        </Arg>
     64      </Call>
     65    </Arg>
     66  </Call>
    3667</Configure>
Note: See TracChangeset for help on using the changeset viewer.