Index: Get.java =================================================================== --- Get.java (revision 519937) +++ Get.java (working copy) @@ -54,6 +54,7 @@ private boolean ignoreErrors = false; private String uname = null; private String pword = null; + private boolean httpUseCache = true; // on by default @@ -139,6 +140,13 @@ "Basic " + encoding); } + //setup http connection caching, must be done before connect + if (connection instanceof HttpURLConnection) { + HttpURLConnection httpConnection = (HttpURLConnection)connection; + log( "http using caches: "+httpUseCache, logLevel ); + httpConnection.setUseCaches( httpUseCache ); + } + //connect to the remote site (may take some time) connection.connect(); //next test for a 304 result (HTTP only) @@ -343,6 +351,17 @@ this.pword = p; } + /** + * HTTP connections only - control caching on the HttpUrlConnection: + * httpConnection.setUseCaches(); + * if false, do not allow caching on the HttpUrlConnection. + * Defaults to true (allow caching, which is also the HttpUrlConnection default value + * + */ + public void setHttpUseCache( boolean httpUseCache ) { + this.httpUseCache = httpUseCache; + } + /** * Provide this for Backward Compatibility. */