rabarron / android-query

Automatically exported from code.google.com/p/android-query
0 stars 0 forks source link

Investigate 304 support. #124

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I am trying to do something like:
connection.setRequestProperty("If-Modified-Since", "Wed, 06 Oct 2010 02:53:46 
GMT");
I see that I should be able to do that via the documentation with:
cb.header("If-Modified-Since", "DATE/TIME OF LAST PULL");
How do I return this as TRUE or FALSE in order to get, not get, the updated 
file?
What is aq.ajax(cb); returning? Or how can I get it to return something?

Original issue reported on code.google.com by tinyeeliu@gmail.com on 6 Mar 2013 at 11:32

GoogleCodeExporter commented 9 years ago
I just used php to get_headers from the file I am trying to access on my server 
and the only items returned are: 

array ( 0 => 'HTTP/1.1 200 OK', 'Date' => 'Wed, 06 Mar 2013 16:17:11 GMT', 
'Server' => 'Apache', 'Last-Modified' => 'Wed, 06 Mar 2013 16:15:01 GMT', 
'Accept-Ranges' => 'bytes', 'Content-Length' => '4504', 'Vary' => 
'Accept-Encoding', 'Connection' => 'close', 'Content-Type' => 
'application/xml', )

So it looks like my server does not send out the If-Modified-Since... Well, 
that helps. What is strange however, is that I never get a 304 response. I only 
get 200. Regardless of when the Last-Modified date is. Does this 
programatically mean that the cache file is not the same as what is coming off 
the server? If I just show the cache file, it is the same... 

Original comment by buildaki...@gmail.com on 6 Mar 2013 at 4:21