title: HTTP Conditional GET
body: <p>I'm trying to check if a file has been modified after a given date. I found this <a href="https://stackoverflow.com/questions/7095897/im-trying-to-use-javas-httpurlconnection-to-do-a-conditional-get-but-i-neve">I&#39;m trying to use Java&#39;s HttpURLConnection to do a &quot;conditional get&quot;, but I never get a 304 status code</a>. which seemed like what I needed. 
  But if I try:</p>
  
  <pre><code>URLConnection connection = new URL("http://cdn3.sstatic.net/stackoverflow/img/favicon.ico").openConnection();
  connection.setRequestProperty("If-Modified-Since", "Wed, 06 Oct 2010 02:53:46 GMT");
  System.out.println(connection.getHeaderFields());
  </code></pre>
  
  <p>The output is: </p>
  
  <pre><code>{null=[HTTP/1.1 200 OK], ETag=["087588e2bb5cd1:0"],
  Date=[Wed, 28 Nov 2012 12:39:31 GMT], Content-Length=[1150],
  Last-Modified=[Sun, 28 Oct 2012 16:44:54 GMT], Accept-Ranges=[bytes],
  Connection=[keep-alive], Content-Type=[image/x-icon], X-Cache=[HIT],
  Server=[NetDNA-cache/2.2], Cache-Control=[max-age=604800]}
  </code></pre>
  
  <p><strong>Edit</strong> </p>
  
  <p>I've tried today's date but still doesn't return 304. </p>
  
  <blockquote>
    <p>Wed, 28 Nov 2012 12:59:56 GMT</p>
  </blockquote>
  
  <p>It should return 304 but as you can see it doesn't, any help is appropriated. </p>