I’ve had yet another person enquiring about it this morning, and I regularly receive questions about it by email, so I may as well make a public clarification on this subject
So : you may have noticed that, when you see a post had only 5 ratings (random number, just an example), and you click to vote, suddenly, it will show that the post, your vote included, has been rated ten times. -> WTF ?!?
Microsoft-style reply : this is NOT a bug. This is a functionality.
More precisely, one word explains it all : the cache.
My blog uses a caching system to dramatically reduce the server impact of the number of visitors on a wordpress platform.
Usually, when you visit a wordpress blog, you cause the server to process a shitload of php files before he can serve you the files you see in your browser, and the server has to query the database several times. And with every new visitor, the server starts everything from scratch. With a cache, instead, the blog will prepare in advance what you and everyone else will see, and will show it to everyone without reprocessing and requerying everything each time. You are not served dynamical but static pages.
And to prevent bugs, the cache will be refreshed every x new visitors, and some elements aren’t cached, like the comments.
Without a caching system, my hosting fees would be 3 or 4 times more expensive.
Sadly, some elements that shouldn’t be stored in cache (that should be processed each time), are still actually cached. Don’t ask me why, this is a bug and I can’t help it.
Two elements suffer from that bug :
- The comments. On rare occasions (most of the time they’re not cached and they load at once), some comments will take 3-4 hours to appear because of that.
(If you don’t see your “FIRST!!” comment, this isn’t a bug, this is that I deleted it as a conditioned reflex.)
- Almost every time : the post ratings, precisely. Your own vote click on a post rating star forces the voting results to be loaded for you, despite the fact that the voting results are cached for people who haven’t voted. Unless you vote, you’re shown cached results.
If you’re a PHP wizard and you’re bored, searching for something awesome to do, you could for instance help with the development of the cache plugin or the post ratings plugin, to fix their mutual incompatibility
At least now, I’ll just have to give a link to this page the next time I’m asked the question
4 Responses to ' A clarification about the post ratings behaving mysteriously '
You liked it ? Hated it ? You've got additional information and links ? Or did you see broken links (please report them, I will reupload it) ? Bring more life here, participate, add a comment ;-)
If you report a dead link, please, tell me what is the precise dead hyperlink and the precise error. Never forget to try again !
Show your avatar in the comments »