Index: src/org/openstreetmap/gui/jmapviewer/OsmFileCacheTileLoader.java
===================================================================
--- src/org/openstreetmap/gui/jmapviewer/OsmFileCacheTileLoader.java	(revision 31043)
+++ src/org/openstreetmap/gui/jmapviewer/OsmFileCacheTileLoader.java	(working copy)
@@ -66,7 +66,7 @@
         } catch (SecurityException e) {
             log.log(Level.WARNING,
                     "Failed to access system property ''java.io.tmpdir'' for security reasons. Exception was: "
-                    + e.toString());
+                            + e.toString());
             throw e; // rethrow
         }
         try {
@@ -293,9 +293,17 @@
                 loadTagsFromFile();
 
                 fileMtime = tileFile.lastModified();
-                if (now - fileMtime > maxAge)
-                    return false;
-
+                if (tile.getValue("expires") != null) {
+                    try {
+                        // if there was Expires/Cache-Control header provided, check against it
+                        if (now > Long.parseLong(tile.getValue("expires")))
+                            return false;
+                    } catch (NumberFormatException e) {}
+                } else {
+                    // otherwise check against static cache policy
+                    if (now - fileMtime > maxAge)
+                        return false;
+                }
                 if ("no-tile".equals(tile.getValue("tile-info"))) {
                     tile.setError("No tile at this zoom level");
                     if (tileFile.exists()) {
@@ -405,8 +413,8 @@
             File file = getTileFile();
             file.getParentFile().mkdirs();
             try (
-                FileOutputStream f = new FileOutputStream(file)
-            ) {
+                    FileOutputStream f = new FileOutputStream(file)
+                    ) {
                 f.write(rawData);
             } catch (Exception e) {
                 log.log(Level.SEVERE, "Failed to save tile content: {0}", e.getLocalizedMessage());
Index: src/org/openstreetmap/gui/jmapviewer/OsmTileLoader.java
===================================================================
--- src/org/openstreetmap/gui/jmapviewer/OsmTileLoader.java	(revision 31043)
+++ src/org/openstreetmap/gui/jmapviewer/OsmTileLoader.java	(working copy)
@@ -108,6 +108,22 @@
         if (str != null) {
             tile.putValue("tile-info", str);
         }
+
+        // get Expiration or Cache-Control: max-age= value
+        Long lng = urlConn.getExpiration();
+        if (lng == null) {
+            str = urlConn.getHeaderField("Cache-Control");
+            if (str != null) {
+                for (String token: str.split(",")) {
+                    if (token.startsWith("max-age=")) {
+                        lng = Long.parseLong(token.substring(8))+System.currentTimeMillis();
+                    }
+                }
+            }
+        }
+        if (lng != null) {
+            tile.putValue("expires", lng.toString());
+        }
     }
 
     protected void prepareHttpUrlConnection(HttpURLConnection urlConn) {
