Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Hit counter

Hit counter

Scheduled Pinned Locked Moved ASP.NET
questiondatabasearchitecturehelp
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Atul Kharecha
    wrote on last edited by
    #1

    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.

    C 1 Reply Last reply
    0
    • A Atul Kharecha

      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.

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      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.

      A 1 Reply Last reply
      0
      • C Christian Graus

        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.

        A Offline
        A Offline
        Atul Kharecha
        wrote on last edited by
        #3

        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.

        C 1 Reply Last reply
        0
        • A Atul Kharecha

          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.

          C Offline
          C Offline
          Christian Graus
          wrote on last edited by
          #4

          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.

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups