IndraGunawan / api-rate-limit-bundle

Rate limits protection for api-platform resources.
MIT License
66 stars 10 forks source link

Rely on PSR instead of doctrine. #1

Closed lyrixx closed 7 years ago

lyrixx commented 7 years ago

Hello.

in the readme, we can read:

The service that is used to persist rate limit metadata. The service has to implement the Doctrine\Common\Cache\Cache interface. If no service id provided then the default storage is Filesystem (location: %kernel.cache_dir%/rate_limit).

IMHO, you should rely on a PSR/Cache interace instead of the doctrine one. More over, in Symfony there is a DoctrineCacheAdapter.

ping @nicolas-grekas

IndraGunawan commented 7 years ago

nice idea, so the configuration receive PSR/Cache implementation service id instead DoctrineCache right? i will refactor to use PSR/Cache

lyrixx commented 7 years ago

Yes :-)

IndraGunawan commented 7 years ago

@lyrixx do you prefer PSR/Cache or PSR/SimpleCache? i see PSR/SimpleCache is enough to handle this

lyrixx commented 7 years ago

Actually, I don't know. In symfony, we support both so ... :D It does not really matter I guess.

nicolas-grekas commented 7 years ago

Clearly PSR/Cache! That's the most flexible, and the one that is easily configurable with a few lines of yaml.