Skip to content

Cache not updated #42

Description

@snfuchs

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions