If I delete everything out of votingapi_cache, it kills my advpoll binary polls. So my first instinct is that this table is not a caching table, it's a history table (?). Rename it?
But... since Eaton proclaims that "cache is not long term storage" here, perhaps the real issue is that advpoll is not using votingapi correctly. I looked in votingapi.module and didn't see anything like a "votingapi_rebuild_cache" function.
Comments
Comment #1
simeOh, it's only temporary. I voted again and the votingapi_cache was repopulated correctly.
Comment #2
eaton commentedThe VotingAPI cache table is basically a convenience table that holds pre-calculated aggregate functions based on the data stored in the votingapi_votes table. If it gets wiped out, the 'brute force' way to reconstruct it is to SELECT DISTINCT (content_id, content_type) FROM votingapi_vote, then call votingapi_recalculate_results($type, $id) on each distinct pair. I suppose that a global 'recalculate everything' function could be done, too...
In most cases, this table won't be wiped out. But it is possible to rebuild its contents using the data in the votes table.
Comment #3
(not verified) commented