mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-07-03 00:12:14 +02:00
added persistent cache for some slow queries in feed notification (even if not important to be fast on RSS feed, it might slow down galleries that are very large and actively used)
git-svn-id: http://piwigo.org/svn/trunk@28560 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user