Index: binary-improvements/7dtd-server-fixes/src/NetConnections/Servers/Web/StaticHandler.cs
===================================================================
--- binary-improvements/7dtd-server-fixes/src/NetConnections/Servers/Web/StaticHandler.cs	(revision 190)
+++ binary-improvements/7dtd-server-fixes/src/NetConnections/Servers/Web/StaticHandler.cs	(revision 199)
@@ -11,9 +11,8 @@
 		private string datapath;
 		private string staticPart;
-		private bool cache;
+		private AllocsFixes.FileCache.AbstractCache cache;
 		private bool logMissingFiles;
-		private Dictionary<string, byte[]> fileCache = new Dictionary<string, byte[]> ();
 
-		public StaticHandler (string staticPart, string filePath, bool cache, bool logMissingFiles)
+		public StaticHandler (string staticPart, string filePath, AllocsFixes.FileCache.AbstractCache cache, bool logMissingFiles)
 		{
 			this.staticPart = staticPart;
@@ -28,33 +27,15 @@
 				string fn = req.Url.AbsolutePath.Remove (0, staticPart.Length);
 
-				byte[] content;
-				if (cache) {
-					lock (fileCache) {
-						if (!fileCache.ContainsKey (fn)) {
-							if (!File.Exists (datapath + "/" + fn)) {
-								throw new FileNotFoundException ();
-							}
-
-							fileCache.Add (fn, File.ReadAllBytes (datapath + "/" + fn));
-						}
-
-						content = fileCache [fn];
-					}
+				byte[] content = cache.GetFileContent (datapath + "/" + fn);
+				if (content != null) {
+					resp.ContentType = MimeType.GetMimeType (Path.GetExtension (fn));
+					resp.ContentLength64 = content.Length;
+					resp.OutputStream.Write (content, 0, content.Length);
 				} else {
-					if (!File.Exists (datapath + "/" + fn)) {
-						throw new FileNotFoundException ();
-					}
-
-					content = File.ReadAllBytes (datapath + "/" + fn);
+					resp.StatusCode = (int)HttpStatusCode.NotFound;
+					if (logMissingFiles)
+						Log.Out ("Web:Static:FileNotFound: \"" + req.Url.AbsolutePath + "\" @ \"" + datapath + "/" + req.Url.AbsolutePath.Remove (0, staticPart.Length) + "\"");
+					return;
 				}
-
-				resp.ContentType = MimeType.GetMimeType (Path.GetExtension (fn));
-				resp.ContentLength64 = content.Length;
-				resp.OutputStream.Write (content, 0, content.Length);
-			} catch (FileNotFoundException) {
-				resp.StatusCode = (int)HttpStatusCode.NotFound;
-				if (logMissingFiles)
-					Log.Out ("Web:Static:FileNotFound: \"" + req.Url.AbsolutePath + "\" @ \"" + datapath + "/" + req.Url.AbsolutePath.Remove (0, staticPart.Length) + "\"");
-				return;
 			} catch (Exception e) {
 				Log.Out ("Error in StaticHandler.HandleRequest: " + e);
Index: binary-improvements/7dtd-server-fixes/src/NetConnections/Servers/Web/Web.cs
===================================================================
--- binary-improvements/7dtd-server-fixes/src/NetConnections/Servers/Web/Web.cs	(revision 190)
+++ binary-improvements/7dtd-server-fixes/src/NetConnections/Servers/Web/Web.cs	(revision 199)
@@ -34,7 +34,23 @@
 				}
  
-				handlers.Add ("/index.htm", new SimpleRedirectHandler ("/static/index.html"));
-				handlers.Add ("/static/", new StaticHandler ("/static/", Application.dataPath + "/../webserver", false/*true*/, true)); // TODO: Enable cache
-				handlers.Add ("/map/", new StaticHandler ("/map/", StaticDirectories.GetSaveGameDir () + "/map", false, false));
+				handlers.Add (
+						"/index.htm",
+						new SimpleRedirectHandler ("/static/index.html"));
+				handlers.Add (
+						"/static/",
+						new StaticHandler (
+								"/static/",
+								Application.dataPath + "/../webserver",
+								new AllocsFixes.FileCache.DirectAccess (),
+								true)
+				); // TODO: Enable cache
+				handlers.Add (
+						"/map/",
+						new StaticHandler (
+								"/map/",
+								StaticDirectories.GetSaveGameDir () + "/map",
+								MapRendering.MapRendering.Instance.TileCache,
+								false)
+				);
 				handlers.Add ("/api/", new ApiHandler ("/api/"));
 
@@ -61,5 +77,5 @@
 				);
 
-				NetTelnetServer.RegisterServer(this);
+				NetTelnetServer.RegisterServer (this);
 
 
