Page 1 of 1

How to enable gzip compression?

Posted: Tue Dec 16, 2014 2:20 pm
by gowthamgutha
I would like to know how to enable gzip compression for static files (js, css, html and images) in broadleaf. I have tried the following in web.xml file of site module.

Code: Select all

    <filter>
       <filter-name>GzipFilter</filter-name>
       <filter-class> org.eclipse.jetty.servlets.GzipFilter</filter-class>
       <init-param>
         <param-name>mimeTypes</param-name>
         <param-value>text/html,text/plain,text/xml,application/xhtml+xml,text/css,application/javascript,image/svg+xml</param-value>
       </init-param>
   </filter>
   
   <filter-mapping>
      <filter-name>GzipFilter</filter-name>
      <url-pattern>/*</url-pattern>
   </filter-mapping>



But still no use. Is there any order on where do I have to paste? Or did I miss doing something?

Thank you.

Re: How to enable gzip compression?

Posted: Mon Feb 02, 2015 1:39 am
by mislaura7
java.lang.NoSuchMethodError:com.sun.jersey.core.reflection.ReflectionHelper.getOsgiRegistryInstance()Lcom/sun/jersey/core/osgi/OsgiRegistry;
atcom.sun.jersey.spi.scanning.AnnotationScannerListener$AnnotatedClassVisitor.getClassForName(AnnotationScannerListener.java:217)atcom.sun.jersey.spi.scanning.AnnotationScannerListener$AnnotatedClassVisitor.visitEnd(AnnotationScannerListener.java:186)at org.objectweb.asm.ClassReader.accept(Unknown Source)
at org.objectweb.asm.ClassReader.accept(Unknown Source)
...The reason I got that is that have a dependency to jersey-client 1.8 in the customization I have made to the site project. jersey-client 1.8 uses jersey-core 1.8 for the default profile while the Demo (and Broadleaf I guess) uses 1.17.1 of jersey-core.

Re: How to enable gzip compression?

Posted: Mon Feb 02, 2015 12:38 pm
by phillipuniverse
You could use dependency exclusions for Jersey 1.8: http://maven.apache.org/guides/introduc ... ncies.html