开发者

Best way to count view when 1 page is cached in cakePHP

开发者 https://www.devze.com 2023-02-17 21:02 出处:网络
I want ask best way to count view when 1 page 开发者_如何学Cis cached in cakePHP. When a page is cached , I use javascript send request to server to + view for post. But i think it cause server is ov

I want ask best way to count view when 1 page 开发者_如何学Cis cached in cakePHP.

When a page is cached , I use javascript send request to server to + view for post. But i think it cause server is overload.


Mike Han's response is incorrect. Cached pages in Cake also bypass app_controller. you will need to do an ajax call from the cached page to some action which increments your view-count database field.


I suspect controller is still in action though the view is cached. Or at least beforeFilter of app controller may still be working. You could do the count there.

0

精彩评论

暂无评论...
验证码 换一张
取 消