Skip to content

Configuration ​

The defaults suit most apps. The settings you are most likely to change have environment variables:

VariableDefault
DYNAMIC_THROTTLE_ENABLEDtrueThe kill switch
DYNAMIC_THROTTLE_STOREyour default cache storeThe cache store that holds the counters
DYNAMIC_THROTTLE_DRIVERautoredis or cache. auto picks Redis on a Redis store
DYNAMIC_THROTTLE_REDIS_CONNECTIONthe store's connectionA dedicated connection with short timeouts is best
DYNAMIC_THROTTLE_PREFIXdt:Apps that share one Redis need different prefixes
DYNAMIC_THROTTLE_DB_CONNECTIONyour default connectionWhere the package's tables live
DYNAMIC_THROTTLE_MANIFEST_REFRESH2Seconds before a server picks up a rule change
DYNAMIC_THROTTLE_MAX_RULES5Enforcing rules that may count one request
DYNAMIC_THROTTLE_COOLDOWN10Seconds to skip a counter store that failed
DYNAMIC_THROTTLE_TELEMETRYtrueRecords each rule's traffic and blocks
DYNAMIC_THROTTLE_SAMPLE_RATE1The share of requests telemetry records

The rest, such as excluded paths and the user scope's guards, is in config/dynamic-throttle.php. To change it, publish the file:

bash
php artisan vendor:publish --tag=dynamic-throttle-config

Released under the MIT License. An independent package, not affiliated with or endorsed by Laravel.