1

Whenever I or someone else posts a question, it says 1 view, but I have never seen it says 0 views, even at the point of first posting where nobody could have even had the time to notice it, let alone go to it, and I don't believe that somebody goes to every question immediately as it is posted, not all the time anyway...

So is it counting the OP, the SmokeDetector bot, or is there some other reason why it will always start off with 1 view and not 0 views?

6

You can't post a question without viewing it. Seems logical that it would always read 1 or higher.

  • Right, so the OP is counted then... – user364819 Sep 4 '15 at 21:59
  • @ParanoidPanda Also when you post the question you're redirected to the question's page, so the page is loaded. Hence the page has been loaded at least once when you read one view. The reported number of views doesn't worry about who's seeing it to increase the counter. So that's technically correct and (drum roll) you can't blame caching for anything. – kos Sep 5 '15 at 0:19
  • @kos: So is there even a split second (even one that we don't see) where it is set to 0? Or even a variable that starts off at 0 and then goes to 1 when the author sees it (which is almost immediately)? Or is its default variable value 1 because it assumes that the author has already seen it? – user364819 Sep 5 '15 at 7:47
  • @ParanoidPanda The number of views is indeed cached (try to reload this page multiple times), hence it's safe to assume that no AJAX request is sent to update the number of views either. So when your browser loads the page, the 1 is the result of the server-side processing. Since that value is cached, it would be pointless to add 1 during the processing of the page, since in all cases but the case in which the value it's updated it's not going to report the right value regardless. My guess is that the counter is set to 1 when submitting the question. – kos Sep 5 '15 at 7:59

You must log in to answer this question.