Package com.jcabi.http.wire
Class ETagCachingWire
java.lang.Object
com.jcabi.http.wire.AbstractHeaderBasedCachingWire
com.jcabi.http.wire.ETagCachingWire
- All Implemented Interfaces:
Wire
Wire that caches requests with ETags.
This decorator can be used when you want to avoid duplicate requests to load-sensitive resources and server supports ETags, for example:
String html = new JdkRequest("http://goggle.com")
.through(ETagCachingWire.class)
.fetch()
.body();
Client will automatically detect if server uses ETags and start adding corresponding If-None-Match to outgoing requests
Client will take response from the cache if it is present or will query resource for that.
The class is immutable and thread-safe.
- Since:
- 2.0
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class com.jcabi.http.wire.AbstractHeaderBasedCachingWire
send
-
Constructor Details
-
ETagCachingWire
Public ctor.- Parameters:
wire- Original wire
-