Closed (fixed)
Project:
Decisions
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
9 Mar 2010 at 16:30 UTC
Updated:
29 Mar 2010 at 15:50 UTC
Jump to comment: Most recent file
Currently we have separate API functions for determining if a user voted and for retrieving the vote array. We cache the fact that the user voted for a particular node, but not the entire vote. If we cache the entire serialized vote, then we get both a fast cache alternative to querying a large votingapi table, and we can remove the binary decisions_voted functionality.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | 737274-b.patch | 19.19 KB | ezra-g |
| #1 | 737274.patch | 14.65 KB | ezra-g |
Comments
Comment #1
ezra-g commentedHere finally is the patch.
I have tested manually (and updated our tests) to make sure that this works with 1click with JS disabled.
Comment #2
anarcat commentedSounds good... but doesn't votingapi cache stuff on its own?
Otherwise, cosmetically, it would be nice for decisions_get_vote_direct() to have proper documentation..
Comment #3
ezra-g commentedThe votingapi caches aggregated results for each content_id and tag. However, it doesn't cache the fact that a user voted and both the {votingapi_cache} and {votingapi_vote} can have well over a million rows as we do in our project, so putting the fact that a user voted in its own cache bin, and serving that bin from Memcached replaces long (maybe .8sec) reads with super-fast reads from memcached :).
Stay tuned for proper documentation -- good catch ;).
Comment #4
ezra-g commentedHere's a revised patch. Since we're loading the entire vote in $node->vote, we can get rid of $node->voted and folks can just use !empty($node->vote) to check whether a user has voted. I plan to commit and roll a new release today.
Comment #5
ezra-g commentedI committed virtually this exact patch.