@Immutable public final class ETagCachingWire extends AbstractHeaderBasedCachingWire
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.
Constructor and Description |
---|
ETagCachingWire(Wire wire)
Public ctor.
|
public ETagCachingWire(Wire wire)
wire
- Original wireCopyright © 2012–2021 jcabi.com. All rights reserved.