本文介绍了什么是捕捉在asp.net MVC的每用户页面浏览量的最佳方式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

什么是捕捉人的页面访问量不会降低系统性能网站上的最好方式。我看到所有的地方是计算器显示的页面浏览量。他们在干什么插入到一个数据库每次我点击页面上的?

what is the best way to capture page views by person without slowing down performance on the site. I see that stackoverflow show page views all over the place. Are they doing an insert into a db everytime i click on a page?

在asp.net-MVC中,是否有跟踪每个用户的页面浏览任何推荐的方式(我的网站有一个登录界面),所以我可以查看哪些页面,人们会和多久

In asp.net-mvc, Is there any recommended way to track page view per user (my site has a login screen) so i can review which pages people are going to and how often

推荐答案

最好的办法可能会是一个global截取请求所有控制器上的所有操作行为过滤器,然后递增数据库为当前用户和页面的计数器。为了节省命中数据库太硬了,你可以依赖于缓存这些价值观和它们无效,每隔几分钟,多少流量你处理。

The best way would probably be a global action filter that intercepts requests to all actions on all controllers, then increments a counter in the database for the current user and page. To save hitting the database too hard, you could cache these values and invalidate them every few minutes, depending on how much traffic you're dealing with.

这篇关于什么是捕捉在asp.net MVC的每用户页面浏览量的最佳方式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-21 11:06