I have a pretty simple use case: Cache the content of a URL with correct and automatic reloading when the content on the remote side changes (for example when "last modified" changes).
How can I do that in Java?
Note: I have spring, guava and commons-lang3 on the classpath but I couldn't find any support for this. Guava supports cache eviction but there is no way to implement per-access checks.
You may use HttpClient Cache.
You could save the checksums of the files in database and compare it with the remote side file.
If it fails reload the file.