“综合浏览量”网络世界中的术语
我正在构建一个网络应用程序,需要实现“该项目被查看的次数”。什么是“被查看”?是每次有人访问该页面还是在同一会话中被计数一次?请帮忙
I'm building a web app and need to implement "how many times the item is being viewed". What is the term of "being viewed"? is it every time someone goes to that page or being counted once for the same session? please help
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
术语“页面视图”基本上有两种类型的定义。
从技术角度来看,它可以代表网络浏览器请求页面的次数。如果您必须优化应用程序的代码,这可能是有趣的信息,但它对于网站的访问者来说几乎没有价值。
访问者更可能感兴趣的是浏览过该页面的人数。尽管您无法精确测量这一点,但您可以通过将会话中的多个请求视为单个视图来获得良好的近似值。如果您的应用程序允许访问者登录,您甚至可以将单个用户的所有请求视为一个页面视图,无论请求何时发出。
由于您将显示页面上的浏览量,因此您可能需要查看该页面的人数,而不是请求数。
There are basically two types of definitions for the term 'page view'.
From a technical point of view, it can represent the times the page has been requested by a web browser. This can be interesting information if you have to optimize your application's code, but it has little to no value for the visitors of your site.
The thing that visitors are more likely to be interested in, is the number of people that have viewed the page. Although you cannot exactly measure this, you can get a good approximation by treating multiple requests within a session as a single view. If your application allows visitors to log in, you can even treat all requests by a single user as one page view, regardless of when the requests were made.
Since you will be presenting the number of views on the page, you'll probably want the number of people that have viewed the page, rather than the number of requests.
这取决于您是要跟踪页面浏览量还是访问者数量。
尽管 StackOverflow 似乎使用每个访问者的“视图”,而不是实际的页面视图。
That depends on whether you want to track Page Views or Number of Visitors..
Though StackOverflow seems to use "Views" per visitor, not actual Page Views.
每当有人访问该页面时。
假设您有一个项目数据库或其他数据库,您将需要一个表示视图的列。每次加载页面时,您都会增加该计数器。
Everytime someone goes to that page.
Assuming you have a database for items, or whatever, you'll need to have a column that represents the view. On every page load you will increment that counter.
它意味着一个页面被浏览的次数。它不依赖于用户会话。与应用范围更相关。
It means the number of times a page has been viewed. It is not tied to a user session. It is more related to the application scope.