private string RefreshCache(string source_file, string cache_file, int resolution)
{
if (File.Exists(cache_file)) {
// not modified
if (File.GetLastWriteTime(cache_file) >= File.GetLastWriteTime(source_file)) {
return cache_file;
}
// modified, clear it
File.Delete(cache_file);
}
return GenerateImage(source_file, cache_file, resolution);
}