Changeset 28560


Ignore:
Timestamp:
May 29, 2014, 7:27:57 AM (6 years ago)
Author:
rvelices
Message:

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)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/functions_notification.inc.php

    r27369 r28560  
    442442function get_recent_post_dates($max_dates, $max_elements, $max_cats)
    443443{
    444   global $conf, $user;
    445 
     444  global $conf, $user, $persistent_cache;
     445
     446  $cache_key = $persistent_cache->make_key('recent_posts'.$user['id'].$user['cache_update_time'].$max_dates.$max_elements.$max_cats);
     447  if ($persistent_cache->get($cache_key, $cached))
     448  {
     449    return $cached;
     450  }
    446451  $where_sql = get_std_sql_where_restrict_filter('WHERE', 'i.id', true);
    447452
     
    494499  }
    495500
     501  $persistent_cache->set($cache_key, $dates);
    496502  return $dates;
    497503}
Note: See TracChangeset for help on using the changeset viewer.