title: What is the best method to GZIP a JSF-Seam web app pages
body: <p>I'm developing an JSF web app on Tomcat, planning to use Seam in the near future, and I want to add compression of our web pages and resources (i.e. Javascript &amp; CSS files). I'm aware of three methods to GZIP responses in a Java web :</p>
  
  <ol>
  <li><p>Use Ehcache GZIP filter: it's used in Appfuse, so it's probably solid and it checks if the user agent supports GZIP before applying it, but it seems to have problems with Seam, which we will be using <a href="http://seamframework.org/Community/EHCacheGZipFilterIncompatibleWithSeam" rel="nofollow noreferrer">http://seamframework.org/Community/EHCacheGZipFilterIncompatibleWithSeam</a>.</p></li>
  <li><p>Use pjl-filter. From the stackoverflow question: <a href="https://stackoverflow.com/questions/550024/tomcat-compression-does-not-add-a-content-encoding-gzip-in-the-header">Tomcat Compression Does Not Add a Content-Encoding: gzip in the Header</a>, it appears it doesn't have any memory leaks, but I don't know if it has problems with Seam or not. </p></li>
  <li><p>Use Tomcat's built in compression - although it may not provide a content encoding (Tomcat 6.0.14 seems to work fine, but you can only provide a black list for what user agents compression should not be applied to.</p></li>
  </ol>
  
  <p>Does anyone have experience with these methods in a JSF-Seam environment? Which is the "best" solution?</p>
  
  <p>Thanks,
  Glen</p>