Changeset 19709 in josm for trunk/src/org/openstreetmap/josm/data/cache/JCSCachedTileLoaderJob.java
- Timestamp:
- 2026-11-27T15:43:57+01:00 (less than one hour ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/cache/JCSCachedTileLoaderJob.java
r19693 r19709 367 367 // and the server answers with a HTTP 304 = "Not Modified" 368 368 Logging.debug("JCS - If-Modified-Since/ETag test: local version is up to date: {0}", getUrl()); 369 // update cache attributes 370 attributes = parseHeaders(urlConn); 371 cache.put(getCacheKey(), cacheData, attributes); 369 updateAttributes(urlConn); 372 370 return true; 373 371 } else if (isObjectLoadable() // we have an object in cache, but we haven't received 304 response code … … 559 557 (lastModified != 0 && lastModified <= attributes.getLastModification()); 560 558 if (ret) { 561 // update attributes 562 attributes = parseHeaders(urlConn); 563 cache.put(getCacheKey(), cacheData, attributes); 559 updateAttributes(urlConn); 564 560 } 565 561 return ret; 562 } 563 564 /** 565 * Updates the cache attributes after the server confirmed that the cached object is still valid. 566 * <p> 567 * The "no tile at this zoom level" marker is kept: it was found from the response which delivered the object, 568 * and a confirmation does not repeat that. Without it, an empty no-tile entry would look like a loaded tile 569 * without an image (see #24893). 570 * @param urlConn the response which confirmed the cached object 571 */ 572 private void updateAttributes(HttpClient.Response urlConn) { 573 final boolean noTileAtZoom = attributes.isNoTileAtZoom(); 574 attributes = parseHeaders(urlConn); 575 attributes.setNoTileAtZoom(noTileAtZoom); 576 cache.put(getCacheKey(), cacheData, attributes); 566 577 } 567 578
Note:
See TracChangeset
for help on using the changeset viewer.
