For 1.2 RC3 I modified the update check so that it first retrieves the last modified date of the project feed (HTTP HEAD method), if the date is newer than the last check than it will download the feed. This should reduce the amount of traffic on our website. [skip ci]

This commit is contained in:
RKrom 2014-11-14 10:45:45 +01:00
parent 380f581bbe
commit c6d6431a81
5 changed files with 51 additions and 2 deletions

View file

@ -98,6 +98,16 @@ namespace GreenshotPlugin.Core {
private static ILog LOG = LogManager.GetLogger(typeof(SourceForgeHelper));
private const String RSSFEED = "http://getgreenshot.org/project-feed/";
/// <summary>
/// This is using the HTTP HEAD Method to check if the RSS Feed is modified after the supplied date
/// </summary>
/// <param name="updateTime">DateTime</param>
/// <returns>true if the feed is newer</returns>
public static bool isRSSModifiedAfter(DateTime updateTime) {
DateTime lastModified = NetworkHelper.GetLastModified(new Uri(RSSFEED));
return updateTime.CompareTo(lastModified) < 0;
}
/// <summary>
/// Read the Greenshot RSS feed, so we can use this information to check for updates
/// </summary>