Skip to content

Shared RateLimiterStore using Symfony cache FilesystemAdapter #18

Answered by pgrimaud
kdefives asked this question in Q&A
Discussion options

You must be logged in to vote

IMHO, you could change the signature of your RateLimiterScore from FilesystemAdapter $cache to CacheItemPoolInterface $cache for interoperability (refs to PSR-6).
Today you're using FS cache, but who knows if tomorrow you'll use another cache system instead?

As you can see, i am using FilesystemAdapter because i do not have any Redis, Memcache or APCu on my server.

Why don't use Redis? Because you're on a shared hosting or other reason?

Redis, Memcache, APCu are (for me & for this case) the best way to cache data with TTL. They will automatically flush data when keys expired and they are accessed over a network.

Also, I implemented a public function "clear", this public function is use…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@kdefives
Comment options

Answer selected by kdefives
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #18 on December 23, 2020 10:20.