Just like the title.
Interface limits the number of accesses for the same user (device)
世界只因有你2017-06-22 11:55:06
Since the question has laravel
in the tag, I recommend the ready-made solution, https://github.com/dingo/api. This package has a feature Rate Limiting
, which should be what you are looking for.
If you want to implement it yourself, it is simple. Use [user_id + device unique code] as the primary key, store the number of visits in redis, record the number of visits, and then the specific frequency and number of times all depend on your implementation strategy