Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to implement jspXCMS browsing times and browsing times cache

2025-01-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

In this article, the editor introduces in detail the "jspXCMS browsing times and browsing times cache how to achieve", the content is detailed, the steps are clear, and the details are handled properly. I hope that this "jspXCMS browsing times and browsing times cache how to achieve" article can help you solve your doubts, following the editor's ideas slowly in depth, together to learn new knowledge.

The browsing times of the article need to cooperate with the script implementation in the template. If there is no corresponding script in the template, the system will not record the browsing times. Using script to achieve the statistics of browsing times is considering that the page may generate static HTML. If you only count the number of clicks when accessing the dynamic address of the article, you will not be able to count the number of clicks after the static page is generated.

The script that counts the number of browsing in the template is the same as the script that displays the number of browsing. You can refer to the implementation in the info_news.html (such as / template/1/default/info_news.html) template. The main code is as follows (jquery.js is required):

Read $("# info_views") .load ("${dy} / info_views/$ {info.id}? d =" + new Date () * 1)

The column can also count the number of visits. If you only need to count the number of browsing times when you visit the column page, add a statistical script only in the column template; if the article under the browsing column is also used as a browsing column, add a statistical script to the article template. In addition, the home page is also a kind of column, so the statistical method is the same as the column.

Read $("# node_views") .load ("${dy} / node_views/$ {node.id}? d =" + new Date () * 1)

The system uses query caching technology to improve the access performance of the page, that is, when the data in the database table is not modified, the previously queried sql statement no longer queries the database, but directly returns the previous query results, which can greatly improve the system performance. However, because the page access action is very frequent, coupled with the browsing statistics function, the database will be updated frequently, which will lead to the invalidation of the query cache. Therefore, the system buffers the number of browsing, which can be set in "system Administration"-"system Settings"-"other Settings" in the background. The table that holds buffers in the database is cms_info_buffer.

After reading this, the article "jspXCMS browsing times and how to cache browsing times" has been introduced. If you want to master the knowledge points of this article, you still need to practice and use it yourself to understand it. If you want to know more related articles, welcome to follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report