Skip to content

Commit 4a7c1ed

Browse files
committed
comments
1 parent 89cecab commit 4a7c1ed

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

SCache.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public HttpResponse get(String key) {
4040

4141
// check if response is still valid
4242
public boolean isValid(String requestURL, HttpResponse response) {
43-
if (!response.isExpired()) {
43+
if (!response.isExpired()) { // TODO: add command line flag
4444
System.out.println("SCACHE: response has not expired");
4545
return true;
4646
}
@@ -52,7 +52,7 @@ public boolean isValid(String requestURL, HttpResponse response) {
5252

5353
HttpResponse newResponse = request.askServerIfvalid(response.lastModified, response.etag); // ask severer
5454
if (newResponse == null) { // if error
55-
return true; // Todo: for debugging
55+
return true; // use the cached response if new response has an unrecoverable error.
5656
}
5757
// HttpResponse r = new HttpRequest(request, response.lastModified, response.etag).send(); // ask server
5858
if (newResponse.status == 304) { // Not modified, so still valid

0 commit comments

Comments
 (0)