Blog Stats not Accurate? (and Exploitable?)
Ever since I wrote my first post here, I had a strange feeling about the "Today's Page Hits" number on the right side of the page. You can imagine I was checking the number again and again to see if I am already popular. But it was not changing! It seemed like I sometimes didn't get the number I expected.
There must be some caching, I thought, perhaps I need to change my browser settings. I remember Internet Explorer having such options refresh every visit to the page, etc. Including the "automatic detect" option I never understood. I'm using Firefox, but there are no such settings there.
Anyway, this would not be a geek enough solution. So I came with this one - add some random get variable to the URL, like:
http://blogs.sun.com/roller/page/roumen/20050401?r=217868734568
If you do this, you can be pretty sure you get the right number of visits. There's no chance for caches, proxies or any other monsters on the way to cheat the client. They all know this is dynamic content and only the server has the right data.
Before you try it, there's a little trick. You need to change the number all the time, because if it remains the same, some caches might become clever enough to pretend they know the answer. You can choose any arbitary variable name, so
http://blogs.sun.com/roller/page/roumen/20050401?tgif=14654654
works too. Oh btw: and it seems to be a small "security" hole, you can get a lot of hits this way, too.
P.S. I've added this way 50 hits to my blog. It's time to go to sleep. Maybe I'll write a small script for this.
Update: I just wrote the script. I have no bad intentions whatsoever (I'm a white hat), just want to try to change the number of hits. I've placed some sleep into the script so that I do one hit per 10 seconds or so to avoid any DoS-like behaviour. Once tested, I'll report this issue to the author of the blog engine and will not do it again. If you have comments, let me know...
Update no.2:
 Saturday's table, real, no photoshop.
|