Hit counter
-
Hi, I want to add Hit counter to my site. I found few ways to do it: 1. Free hit counters - Problem is it adds site's links/signature. 2. Hit counter using file based storage - File can be crashed when lots of concurrent hits. 3. Database hit counter - Slowdowns the page load. What is best way to implement it. It's my intranet company site where I need to do it. Any suggestion from the architecture point view? Thanks.
-
Hi, I want to add Hit counter to my site. I found few ways to do it: 1. Free hit counters - Problem is it adds site's links/signature. 2. Hit counter using file based storage - File can be crashed when lots of concurrent hits. 3. Database hit counter - Slowdowns the page load. What is best way to implement it. It's my intranet company site where I need to do it. Any suggestion from the architecture point view? Thanks.
It's trivial to do. Make all your pages derive from a base class which increments your counter. Just use locking to ensure that you only have one thread accessing it at a time. A db write is not going to slow down your page.
Christian Graus Driven to the arms of OSX by Vista.
-
It's trivial to do. Make all your pages derive from a base class which increments your counter. Just use locking to ensure that you only have one thread accessing it at a time. A db write is not going to slow down your page.
Christian Graus Driven to the arms of OSX by Vista.
Thanks Christian, Do I need to use Application/session variable for this? I do not want to keep it increasing for a single user, when he refresh page each time.
-
Thanks Christian, Do I need to use Application/session variable for this? I do not want to keep it increasing for a single user, when he refresh page each time.
Oh, you want it per user. Then you need to use the session start event.
Christian Graus Driven to the arms of OSX by Vista.