HttpResponseCache icon indicating copy to clipboard operation
HttpResponseCache copied to clipboard

Cache not updated

Open snfuchs opened this issue 12 years ago • 0 comments

Seems to me that the cache is not updated, when newer files are available on the server. To test, I wrote this little test: public void testServerReturnsDocumentNewerThanCache() throws Exception { server.enqueue(new MockResponse().setBody("A") .addHeader("Last-Modified: " + formatDate(-4, TimeUnit.HOURS))); server.enqueue(new MockResponse().setBody("B") .addHeader("Last-Modified: " + formatDate(-2, TimeUnit.HOURS))); server.play();

    URL url = server.getUrl("/");

    assertEquals("A", readAscii(url.openConnection()));
    assertEquals("B", readAscii(url.openConnection()));
}

It fails on the last assert. A is returned instead of B.

snfuchs avatar Aug 01 '13 22:08 snfuchs