Yann Malet committed 3f23976

Add a setting to control the default timeout of the cache for the feeds

Comments (0)

Files changed (2)


 from cmsplugin_feed.models import Feed
 from cmsplugin_feed.forms import FeedForm
+from cmsplugin_feed.settings import CMSPLUGIN_FEED_CACHE_TIMEOUT
 def get_cached_feed(instance):
     if not cache.has_key("feed_%s"
         feed = feedparser.parse(instance.feed_url)
-        cache.set("feed_%s", feed, 100)
+        cache.set("feed_%s", feed, CMSPLUGIN_FEED_CACHE_TIMEOUT)
     return cache.get("feed_%s"
 class FeedPlugin(CMSPluginBase):


+This module enforces default settings when the main settings module does not
+contain the appropriate settings.
+from django.conf import settings
+# Define the cache timeout in second for the feed
+# default is 3600s (1 hour)
+                                       'CMSPLUGIN_FEED_CACHE_TIMEOUT', 3600)