Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGreg Wilkins2015-09-17 04:15:13 -0400
committerGreg Wilkins2015-09-17 04:19:58 -0400
commit2d88fdf386d008994a71a095cbc672ecc7575552 (patch)
treeb914b80c3f3fcaa8253af332315a990d5bb0cddc /jetty-servlets
parent03a601f2b246a278961203a4b183100156d44dc1 (diff)
downloadorg.eclipse.jetty.project-2d88fdf386d008994a71a095cbc672ecc7575552.tar.gz
org.eclipse.jetty.project-2d88fdf386d008994a71a095cbc672ecc7575552.tar.xz
org.eclipse.jetty.project-2d88fdf386d008994a71a095cbc672ecc7575552.zip
477278 Refactored DefaultServlet for cached Gzip & Etags
Refactored the DefaultServlet to better handle static gzipped files with etags in the cache. Required a simplification of always having a HttpContent rather than the prior situation of having either a Resource or a HttpContent. So introduced a HttpContent.Factory, of which the ResourceCache is the normal implementation, but there is also now a ResourceContentFactory that creates content when there is no cache. The Gzip resource is now associated with the normal resource, so less lookups are needed. This also give scope for caching dynamic gzipping in the future. The GzipHttpContent class has been introduced to send content with the headers of the uncompress, but content of the compressed resource.
Diffstat (limited to 'jetty-servlets')
-rw-r--r--jetty-servlets/src/test/java/org/eclipse/jetty/server/handler/gzip/GzipDefaultTest.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/jetty-servlets/src/test/java/org/eclipse/jetty/server/handler/gzip/GzipDefaultTest.java b/jetty-servlets/src/test/java/org/eclipse/jetty/server/handler/gzip/GzipDefaultTest.java
index 96dbf03cbc..78d5483961 100644
--- a/jetty-servlets/src/test/java/org/eclipse/jetty/server/handler/gzip/GzipDefaultTest.java
+++ b/jetty-servlets/src/test/java/org/eclipse/jetty/server/handler/gzip/GzipDefaultTest.java
@@ -38,6 +38,7 @@ import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
+import org.eclipse.jetty.http.GzipHttpContent;
import org.eclipse.jetty.http.HttpHeader;
import org.eclipse.jetty.http.HttpStatus;
import org.eclipse.jetty.http.HttpTester;
@@ -147,7 +148,7 @@ public class GzipDefaultTest
//A HEAD request should have similar headers, but no body
response = tester.executeRequest("HEAD","/context/file.txt",5,TimeUnit.SECONDS);
assertThat("Response status",response.getStatus(),is(HttpStatus.OK_200));
- assertThat("ETag", response.get("ETag"), containsString(GzipHandler.ETAG_GZIP));
+ assertThat("ETag", response.get("ETag"), containsString(GzipHttpContent.ETAG_GZIP));
assertThat("Content encoding", response.get("Content-Encoding"), containsString("gzip"));
assertNull("Content length", response.get("Content-Length"));

Back to the top