Disable the JRE HTTP cache, if any

We don't want to use the JRE cache when fetching content.

Change-Id: Id76f3e618967c98ed4fbc47a1a2a9e77acbe41ab
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
This commit is contained in:
Shawn O. Pearce 2010-01-23 13:42:56 -08:00
parent 0238a21b62
commit e905d93f9f
1 changed files with 1 additions and 0 deletions

View File

@ -373,6 +373,7 @@ private HttpURLConnection connect(final String service)
final HttpURLConnection httpOpen(final URL u) throws IOException {
final Proxy proxy = HttpSupport.proxyFor(proxySelector, u);
HttpURLConnection conn = (HttpURLConnection) u.openConnection(proxy);
conn.setUseCaches(false);
conn.setRequestProperty(HDR_ACCEPT_ENCODING, ENCODING_GZIP);
conn.setRequestProperty(HDR_PRAGMA, "no-cache");//$NON-NLS-1$
conn.setRequestProperty(HDR_USER_AGENT, userAgent);