Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8429657
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T05:23:51+00:00 2026-06-10T05:23:51+00:00

I was recently brought a challenge from a friend. Thought I’d share it here

  • 0

I was recently brought a challenge from a friend. Thought I’d share it here because I have no good solution.

Say I need a visitor hits count for my website, the count would permanently increase on every visit.

The Problem

It is considered bad practice to change the server state with GET requests. And since I’d like to keep count of the number of users that entered my website, I’ll have to store the state somehow.

How would I approach this? Should I break that practice and change the server on GET requests? Or is there some more elaborate scheme I can pull off?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T05:23:53+00:00Added an answer on June 10, 2026 at 5:23 am

    The assertion you’re making is generally true. But here, you want precisely to track if someone made a GET request. So doing this treatment on such requests makes sense!

    It’s just a bit tricky when using in combination with a caching mechanism. Because the part where you count the visitor can’t be in cache, you always need server-side to track the count.

    Other solutions include:

    • External tools like Google Analytics uses JavaScript with a tracking image (the retrieval of the image is a way to simulate the POST request, but it’s just GET anyway), in combination with a cookie to track only unique visitors.
    • Log analysis is another alternative. Web servers can write every request in a file, along with other informations (such as IP address, User-Agent). Analyzing the access log can be solution.

    [edit] I particularly like the tracking image. Makes both solutions easier.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Someone here recently brought up the article from Scott Meyers that says: Prefer iterators
I recently had an app rejected from the app store because of Low Memory
I have good knowledge on C++ (not C) and recently bought a Symbian-based phone.
A friend of mine brought up this questiont he other day, he's recently bought
I've recently been playing around with PostSharp, and it brought to mind a problem
I know recently Spring 3.0 was released which brought about a nice new set
So, folks. Got an interesting occurrence going on here. I have a windows forms
I recently bought some webspace with dailyrazor.com. I have deployed an application I have
I recently had to drop the Django development server and moved to apache because
I have a Visual Studio 2010 C# webforms solution with various projects in it.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.