A clarification about the post ratings behaving mysteriously

1 Star2 Stars3 Stars4 Stars5 Stars (30 votes, average: 3.77 out of 5)
Loading...
By Oliver AKA The Admin on 4 comments
in Categories: Just Talking

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 ;)

Subscribe
Notify of
guest

4 Comments
oldest
newest most voted
Inline Feedbacks
View all comments
nacho29
nacho29
13 years ago

hmm….that interesting and efficient for you

Teena
Teena
13 years ago

(If you don’t see your “FIRST!!” comment, this isn’t a bug, this is that I deleted it as a conditioned reflex.)
I LOL'ed at that one. Thumbs up :D

Reideen
Reideen
13 years ago
Reply to  Teena

Lol – yeah I LOL'ed to that one, too XD