gnu-social/lib
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
..
action.php gettext strings and pass the query string between tabs http://laconi.ca/PITS/00231 2008-07-20 06:56:59 -04:00
common.php cache noticesWithFriends in memcached 2008-09-15 02:56:16 -04:00
daemon.php add newline at the end of pidfile 2008-09-04 15:15:17 -04:00
deleteaction.php Clean up delete code. Add missing htaccess rule. Exit after errors so the code doesn't continue running. 2008-07-20 08:45:52 -04:00
gallery.php reverse order of queries for galleries 2008-09-11 10:47:42 -04:00
jabber.php free and unset DB_DataObjects after we're done with them 2008-09-05 21:55:01 -04:00
language.php Add other languages to drop down 2008-08-04 22:05:20 -04:00
mail.php free memory in SMS daemon, too 2008-09-05 21:56:21 -04:00
noticewrapper.php cache noticesWithFriends in memcached 2008-09-15 02:56:16 -04:00
oauthstore.php Merge conflicts and kill a whole lot of trailing whitespace on lines. 2008-07-09 18:46:30 -04:00
omb.php remove some debugging code from omb.php 2008-09-07 16:03:44 -04:00
openid.php p.instructions -> div.instructions 2008-07-08 20:22:42 -04:00
queuehandler.php free and unset DB_DataObjects after we're done with them 2008-09-05 21:55:01 -04:00
rssaction.php base class is_readonly() now returns false by default 2008-07-22 17:20:56 -04:00
searchaction.php make settings and search menus localisable 2008-08-17 11:02:44 -04:00
settingsaction.php make settings and search menus localisable 2008-08-17 11:02:44 -04:00
stream.php try to make the reply button do the right thing if there's no notification box. 2008-08-26 21:50:10 -04:00
subs.php XMPP sub/unsub and help commands 2008-08-22 15:10:32 -04:00
theme.php theme server support 2008-07-16 16:59:47 -04:00
twitterapi.php Twitter-compatible API - moved show() to the right file 2008-08-18 20:39:31 -04:00
util.php cache noticesWithFriends in memcached 2008-09-15 02:56:16 -04:00
xmppqueuehandler.php LOG_ERROR -> LOG_ERR 2008-09-13 12:11:07 -04:00