To start using httpcache4j immediately please do the following:
add this to your POM-file.
You then need to instantiate a HTTPCache with a storage backend and a response resolver.
The cache is now ready to use and can serve / resolve requests.
You can use it like this:
The cache will then perform a HTTP GET to http://www.vg.no and cache this if possible.
The next request will then be served from the cache, if the TTL has not exipired.
If you want to bypass the cache, but still want the response to be cached, you can use the:
This works like the browser ctrl + F5 (Firefox); force a refresh.
Labels
