Changeset 487 for TFP-WebServer/WebServer/src/FileCache
- Timestamp:
- Jun 17, 2024, 5:25:43 PM (7 months ago)
- Location:
- TFP-WebServer/WebServer/src/FileCache
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
TFP-WebServer/WebServer/src/FileCache/InvalidateCachesCmd.cs
r405 r487 5 5 [UsedImplicitly] 6 6 public class InvalidateCachesCmd : ConsoleCmdAbstract { 7 p rotectedoverride string[] getCommands () {7 public override string[] getCommands () { 8 8 return new[] {"invalidatecaches"}; 9 9 } 10 10 11 p rotectedoverride string getDescription () {11 public override string getDescription () { 12 12 return "Invalidate contents of web file caches"; 13 13 } 14 14 15 p rotectedoverride string getHelp () {15 public override string getHelp () { 16 16 return "TODO"; 17 17 } -
TFP-WebServer/WebServer/src/FileCache/SimpleCache.cs
r402 r487 11 11 try { 12 12 lock (fileCache) { 13 if (fileCache. ContainsKey (_filename)) {14 return fileCache [_filename];13 if (fileCache.TryGetValue(_filename, out byte[] content)) { 14 return content; 15 15 } 16 16 … … 19 19 } 20 20 21 fileCache.Add (_filename, File.ReadAllBytes (_filename)); 21 byte[] newContent = File.ReadAllBytes (_filename); 22 fileCache.Add (_filename, newContent); 22 23 23 return fileCache [_filename];24 return newContent; 24 25 } 25 26 } catch (Exception e) {
Note:
See TracChangeset
for help on using the changeset viewer.