On my site I need to throttle user requests for various reasons:
- Prevent overquerying of database or 3rd party apis
- Prevent spam
- Preventing others from scraping my data
I was wondering what the best practices are for throttling? Should it be done at the script level (PHP/MySQL) or at the server level (Apache)?
And are there any specific best practices I should keep in mind with regards to throttling?