aboutsummaryrefslogtreecommitdiff
path: root/app/Models/Feed.php
diff options
context:
space:
mode:
Diffstat (limited to 'app/Models/Feed.php')
-rw-r--r--app/Models/Feed.php14
1 files changed, 13 insertions, 1 deletions
diff --git a/app/Models/Feed.php b/app/Models/Feed.php
index d09577e6e..e1dd2990d 100644
--- a/app/Models/Feed.php
+++ b/app/Models/Feed.php
@@ -286,6 +286,10 @@ class FreshRSS_Feed extends Minz_Model {
if (!$loadDetails) { //Only activates auto-discovery when adding a new feed
$feed->set_autodiscovery_level(SIMPLEPIE_LOCATOR_NONE);
}
+ if ($this->attributes('clear_cache')) {
+ // Do not use `$simplePie->enable_cache(false);` as it would prevent caching in multiuser context
+ $this->clearCache();
+ }
Minz_ExtensionManager::callHook('simplepie_before_init', $feed, $this);
$mtime = $feed->init();
@@ -465,8 +469,16 @@ class FreshRSS_Feed extends Minz_Model {
$this->entries = $entries;
}
+ protected function cacheFilename() {
+ return CACHE_PATH . '/' . md5($this->url) . '.spc';
+ }
+
+ public function clearCache() {
+ return @unlink($this->cacheFilename());
+ }
+
public function cacheModifiedTime() {
- return @filemtime(CACHE_PATH . '/' . md5($this->url) . '.spc');
+ return @filemtime($this->cacheFilename());
}
public function lock() {