Previous Thread
Next Thread
Print Thread
Rate Thread
#249867 06/10/2003 9:42 AM
Joined: May 1999
Posts: 1,715
Addict
Addict
Joined: May 1999
Posts: 1,715
Suddenly the view counter on my site seems way off. A user mentioned that it adds two for every time a thread is visited, but when I checked yesterday it worked fine for me. Today, it does the same thing for me, and at least several others as well. It has also been mentioned some time ago, but it worked fine for me then so I never checked up on it.

Looking at the code there is nothing which could create this phenomenon, there is only one place where the counter is updated in both showthreaded and showflat. At first I though that there might be a bug in my MySQL version (4.0.12) but checking other installations at the same server with the same code it works just fine.

I'm at a loss as to what could be causing this and now I'm wondering if anyone else has noticed this.

Sponsored Links
Joined: Jun 2003
Posts: 1,025
Junior Member
Junior Member
Offline
Joined: Jun 2003
Posts: 1,025
I haven't seen anything like this. Maybe you have a corrupt table. Just throwing it out there.

Joined: May 1999
Posts: 1,715
Addict
Addict
Joined: May 1999
Posts: 1,715
Nope, I've made an integrity check on the table so it's not that either. And if it was, it shouldn't be a problem with an old copy of the database either.

Joined: Jun 2003
Posts: 1,025
Junior Member
Junior Member
Offline
Joined: Jun 2003
Posts: 1,025
So, after restoring a DB backup the problem still occours. Hmmm.

Joined: May 1999
Posts: 1,715
Addict
Addict
Joined: May 1999
Posts: 1,715
No, I haven't restored from a backup. I've done an integretiy check with mysiamchk which reports no problems at all. It's just that the exact same problem occurs on an old copy of the database which I use to insert hacks to the code before I add them to the production site. The testing site, where I do all my hacking, works perfectly fine -- the showthread/showflat scripts are exactly the same on it, the databases are on the same database server and the tables should be the same except for the amount of data in them. Very strange indeed.

Sponsored Links
Joined: May 1999
Posts: 1,715
Addict
Addict
Joined: May 1999
Posts: 1,715
This is beyond weird... When I enter the post, the post count is incremented by one just as it should, at least according to the view counter in the extra info box. But when I go back to the postlist, the number is incremented by one again, regardless of if I use the back button in the browser or click on "Index". Also, sometimes the counter is incremented even though vc is sent to the page, which should surpress the increment.

Going to add an adminlog to whenever the post count is incremented now...

Joined: Jun 2003
Posts: 1,025
Junior Member
Junior Member
Offline
Joined: Jun 2003
Posts: 1,025
I have no idea what that could be. Do you think it might be something in a footer(or something else that is on every page)?

Joined: May 1999
Posts: 1,715
Addict
Addict
Joined: May 1999
Posts: 1,715
OK, when I added the admin_log at the increment I found that the increment is run twice, so I took a look at the access log again. It seems that every request is doubled, with a two second delay (which is why I didn't notice it when I looked at the log for the production site). The second request increments the counter without it being shown, since it is the first query that is sent back to the browser.

It seems that I get every request twice, or at least the ones to showflat/showthreaded... If this is true it means that I'm using way too much cpu and bandwidth than necessary... Not sure if this applies to all requests though... Need to check on this a bit more.

Joined: May 1999
Posts: 1,715
Addict
Addict
Joined: May 1999
Posts: 1,715
I'm very confused... When I load showflat, the webserver gets a second request about 2 seconds later, which it processes. The referer on the second request is the url of the first request...

If I add debug=1 to the url, the second request doesn't happen. But as far as I know, this only surpresses the template files and shows information about the queries. I don't understand why that should stop the second request from happening.

These doubled requests seems to happen on php pages, but not on all sites on the server...

Update: It seems to be Mozilla 1.3 that is the guilty party. Tried it with Opera 7.11 and the server only gets one request. Also tried with mozilla on another server with a completely different setup and I got more than one request there as well. The strange thing is, I don't think all who reported the counter problem uses mozilla, so my guess MSIE does this as well. I think I need to kick some browser developer butt, but now I have to get some sleep, maybe all becomes clear in the morning. =]

Last edited by Gardener; 06/10/2003 8:59 PM.
Joined: Jun 2003
Posts: 1,025
Junior Member
Junior Member
Offline
Joined: Jun 2003
Posts: 1,025
Thanks for keeping us updated.

Sponsored Links
Joined: May 1999
Posts: 1,715
Addict
Addict
Joined: May 1999
Posts: 1,715
Well, I really need help on this, and the real problem keeps changing... I don't know why mozilla and konqueror both make multiple request on one of my sites, but not all, and on my server at home. Opera only makes one request on the problem site, but makes more than one on my home server... This is really weird...

I need to get some tcp sniffer to see if the requests are actually sent.

c0bra #249878 06/12/2003 12:37 PM
Joined: Jun 2003
Posts: 1,025
Junior Member
Junior Member
Offline
Joined: Jun 2003
Posts: 1,025
Any luck with this yet? I am baffled.

Joined: Dec 2000
Posts: 1,471
Addict
Addict
Offline
Joined: Dec 2000
Posts: 1,471
Just a suggestion:
Is "Link prefechting" enabled in your Mozilla preferences?
I don't know exactly if it's in 1.3. In 1.4 you'll find it under preferences-->advanced-->cache.

Maybe that causes the second request.

Joined: Oct 2000
Posts: 2,223
Veteran
Veteran
Offline
Joined: Oct 2000
Posts: 2,223
Gardener, check to see if it works the same using Mozilla with pipelining(sp?) off, then on.

They have had a lot of problems with that preference.


Picture perfect penmanship here.
Joined: May 1999
Posts: 1,715
Addict
Addict
Joined: May 1999
Posts: 1,715
Haven't checked with pipelining, unless it's the same as link prefetching, but the later didn't make any difference when I tried it a couple of days ago and no luck today either. Might try it again though since I was a bit tired when I tried to fix this strange occurance. But since it happens to a lot of people I don't believe it's a mozilla thing, since most people still use msie. Also, it doesn't happen on all sites on my server with my mozilla...

Will check with a sniffer to see what requests are actually sent, to see if the problem is with my server or with the browser.

Joined: Jun 2003
Posts: 1,025
Junior Member
Junior Member
Offline
Joined: Jun 2003
Posts: 1,025
Did you ever get this figured out?

Joined: May 1999
Posts: 1,715
Addict
Addict
Joined: May 1999
Posts: 1,715
Haven't had time to check on it and it hasn't been critical, especially since the other big site I host fixed a loop bug they had which relieved the server of a lot of load.

I still do get double requests though. Tried it with Konqueror as well with the same result. Lynx from the server itself as well as from my home computer only results in one request. This is just too weird.

Joined: May 1999
Posts: 1,715
Addict
Addict
Joined: May 1999
Posts: 1,715
Well, I just installed Firebird and the Live HTTP headers plugin to check what requests are getting sent. It turns out that for some reason an extra request for php pages are being sent when all images on the page has been loaded.


Link Copied to Clipboard
Donate Today!
Donate via PayPal

Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.

Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
AllenAyres
AllenAyres
Texas
Posts: 21,079
Joined: March 2000
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20221218)