Combined approach of slidingLogs and fixedWindow with lower storage
costs than slidingLogs and improved boundary behavior by calculating a
weighted score between two windows.
Pro:
Good performance allows this to scale to very high loads.
The getExpiration method should return the expiration as Date.
This method is optional, if defined rate limiter data will be cleaned up when expired.
If not defined the rate limiter data will be stored forever.
Combined approach of
slidingLogsandfixedWindowwith lower storage costs thanslidingLogsand improved boundary behavior by calculating a weighted score between two windows.Pro:
Good performance allows this to scale to very high loads.
Con:
Nothing major.
IMPORT_PATH:
"@daiso-tech/core/rate-limiter/policies"