gnu-social/classes
Evan Prodromou f246b8f2d7 cache noticesWithFriends in memcached
noticesWithFriends is turning out to be one of our most expensive
queries. The join is costly, and this method is hit over and over and
over by desktop clients and other API users.

So, I've added a first pass at caching the results. I store a "window"
of notices -- equal to the first 3 pages of notices, plus one for
pagination -- in the memcached cache. If with-friends notices are
requests, I fetch the whole window out of the cache and grab the slice
requested. If the requested notices are outside the window, we just do
the query. If there's nothing in the cache, we request the window and
store it, then return a slice.

I had to add a NoticeWrapper class that works like DB_DataObject
(well, just the fetch() part...) but just holds an array of notices
instead of a DB cursor.

Finally, saving a new notice blows away the caches for subscribed users.

darcs-hash:20080915065616-84dde-1b1e814c2294498a10b763b779cbb62c3f96aa84.gz
2008-09-15 02:56:16 -04:00
..
Avatar.php replies from people you're not subscribed to over Jabber 2008-07-15 15:55:13 -04:00
Confirm_address.php replies from people you're not subscribed to over Jabber 2008-07-15 15:55:13 -04:00
Consumer.php replies from people you're not subscribed to over Jabber 2008-07-15 15:55:13 -04:00
Fave.php first step towards adding favorites to the system 2008-08-13 10:26:37 -04:00
Foreign_service.php add database tables for foreign services 2008-08-19 18:12:14 -04:00
Foreign_subscription.php add database tables for foreign services 2008-08-19 18:12:14 -04:00
Foreign_user.php add database tables for foreign services 2008-08-19 18:12:14 -04:00
Nonce.php replies from people you're not subscribed to over Jabber 2008-07-15 15:55:13 -04:00
Notice.php cache noticesWithFriends in memcached 2008-09-15 02:56:16 -04:00
Notice_source.php extend length of source for notices 2008-07-31 11:27:31 -04:00
Notice_tag.php extend length of source for notices 2008-07-31 11:27:31 -04:00
Profile.php replies from people you're not subscribed to over Jabber 2008-07-15 15:55:13 -04:00
Queue_item.php log transport when claiming a notice 2008-08-30 01:49:33 -04:00
Remember_me.php replies from people you're not subscribed to over Jabber 2008-07-15 15:55:13 -04:00
Remote_profile.php replies from people you're not subscribed to over Jabber 2008-07-15 15:55:13 -04:00
Reply.php replies from people you're not subscribed to over Jabber 2008-07-15 15:55:13 -04:00
Sms_carrier.php start sms settings 2008-07-20 15:30:05 -04:00
Subscription.php replies from people you're not subscribed to over Jabber 2008-07-15 15:55:13 -04:00
Token.php replies from people you're not subscribed to over Jabber 2008-07-15 15:55:13 -04:00
User.php cache noticesWithFriends in memcached 2008-09-15 02:56:16 -04:00
User_openid.php replies from people you're not subscribed to over Jabber 2008-07-15 15:55:13 -04:00
stoica.ini change queue_item to use a compound primary key 2008-08-27 17:12:39 -04:00
stoica.links.ini first step towards adding favorites to the system 2008-08-13 10:26:37 -04:00