summaryrefslogtreecommitdiff
path: root/lib/noticewrapper.php
AgeCommit message (Collapse)Author
2008-09-15make NoticeWrapper extend Notice so methods workEvan Prodromou
darcs-hash:20080915073006-84dde-8ea7daa73743647711a8c1d7389894b25f2b077d.gz
2008-09-15another attribute errorEvan Prodromou
darcs-hash:20080915072738-84dde-377131613c91dcb353bc6aaf55bae8ce1b7f13e5.gz
2008-09-15misused instance attribute in noticewrapperEvan Prodromou
darcs-hash:20080915072553-84dde-6de01a486dfcf3440643584d1f698fe1b188f351.gz
2008-09-15array_count -> countEvan Prodromou
darcs-hash:20080915070951-84dde-be26f8844c884b0210cfd6165fd3403ce760195e.gz
2008-09-15cache noticesWithFriends in memcachedEvan Prodromou
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