aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--include/functions_notification.inc.php8
1 files changed, 7 insertions, 1 deletions
diff --git a/include/functions_notification.inc.php b/include/functions_notification.inc.php
index 623369915..bc4d1a374 100644
--- a/include/functions_notification.inc.php
+++ b/include/functions_notification.inc.php
@@ -441,8 +441,13 @@ function news($start=null, $end=null, $exclude_img_cats=false, $add_url=false)
*/
function get_recent_post_dates($max_dates, $max_elements, $max_cats)
{
- global $conf, $user;
+ global $conf, $user, $persistent_cache;
+ $cache_key = $persistent_cache->make_key('recent_posts'.$user['id'].$user['cache_update_time'].$max_dates.$max_elements.$max_cats);
+ if ($persistent_cache->get($cache_key, $cached))
+ {
+ return $cached;
+ }
$where_sql = get_std_sql_where_restrict_filter('WHERE', 'i.id', true);
$query = '
@@ -493,6 +498,7 @@ SELECT
}
}
+ $persistent_cache->set($cache_key, $dates);
return $dates;
}