How do I limit anti-irrigation? I would like to talk about the requirement first. to prevent users from posting too frequently, it is necessary to limit how long it will take for them to send messages again. The methods are as follows: 1. use the database to include the last posting time of each user, and then judge. 2. use cache and memcache to set the cache expiration time as the interval. Is there any good way to do this? during the time when posting is prohibited, you should also be prompted how to restrict anti-bumping?
I would like to talk about the requirement first. to prevent users from posting too frequently, it is necessary to limit how long it will take for them to send messages again. The methods are as follows: 1. use the database to include the last posting time of each user, and then judge. 2. use cache and memcache to set the cache expiration time as the interval. In the end, there is a good way to do this. in the time when posting is prohibited, you must also be prompted how many times you can post again ..
------ Solution --------------------
Last posting timestamp + 30 seconds-the current timestamp is the remaining time
------ Solution --------------------
Use a database or memcache to record sessions and cookies. Once cleared, it will be gone.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service