Add to method URLtoByteArray() the support to check for the header "Last-Modified" (i.e. HttpHeaders.LAST_MODIFIED) so we only download a file if it was modified. Here we could have the following approaches:
- the URLtoByteArray() will cache the header value (e.g. with MultiVMPoolUtil) automatically and we would pass a parameter (e.g. boolean checkLastModified) to determine if we want to use this feature or not. The cache name would be a public constant (e.g. Http.CACHE_NAME) so that we could also manipulate the cached value.
- the developer is responsible to cache the header value, pass it as a parameter (e.g. String lastModified) and get the updated value from the response object.
I believe that the approach 1 is the best in terms of flexibility.