|
@@ -301,8 +301,12 @@ func RefreshFeed(store *storage.Storage, userID, feedID int64, forceRefresh bool
|
|
|
return localizedError
|
|
return localizedError
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- // If the feed has a TTL defined, we use it to make sure we don't check it too often.
|
|
|
|
|
- refreshDelayInMinutes = updatedFeed.TTL
|
|
|
|
|
|
|
+ // Use the RSS TTL value, or the Cache-Control or Expires HTTP headers if available.
|
|
|
|
|
+ // Otherwise, we use the default value from the configuration (min interval parameter).
|
|
|
|
|
+ feedTTLValue := updatedFeed.TTL
|
|
|
|
|
+ cacheControlMaxAgeValue := responseHandler.CacheControlMaxAgeInMinutes()
|
|
|
|
|
+ expiresValue := responseHandler.ExpiresInMinutes()
|
|
|
|
|
+ refreshDelayInMinutes = max(feedTTLValue, cacheControlMaxAgeValue, expiresValue)
|
|
|
|
|
|
|
|
// Set the next check at with updated arguments.
|
|
// Set the next check at with updated arguments.
|
|
|
originalFeed.ScheduleNextCheck(weeklyEntryCount, refreshDelayInMinutes)
|
|
originalFeed.ScheduleNextCheck(weeklyEntryCount, refreshDelayInMinutes)
|
|
@@ -310,6 +314,10 @@ func RefreshFeed(store *storage.Storage, userID, feedID int64, forceRefresh bool
|
|
|
slog.Debug("Updated next check date",
|
|
slog.Debug("Updated next check date",
|
|
|
slog.Int64("user_id", userID),
|
|
slog.Int64("user_id", userID),
|
|
|
slog.Int64("feed_id", feedID),
|
|
slog.Int64("feed_id", feedID),
|
|
|
|
|
+ slog.String("feed_url", originalFeed.FeedURL),
|
|
|
|
|
+ slog.Int("feed_ttl_minutes", feedTTLValue),
|
|
|
|
|
+ slog.Int("cache_control_max_age_in_minutes", cacheControlMaxAgeValue),
|
|
|
|
|
+ slog.Int("expires_in_minutes", expiresValue),
|
|
|
slog.Int("refresh_delay_in_minutes", refreshDelayInMinutes),
|
|
slog.Int("refresh_delay_in_minutes", refreshDelayInMinutes),
|
|
|
slog.Time("new_next_check_at", originalFeed.NextCheckAt),
|
|
slog.Time("new_next_check_at", originalFeed.NextCheckAt),
|
|
|
)
|
|
)
|