-
Notifications
You must be signed in to change notification settings - Fork 80
Open
Description
Hi!
We currently have some issues with usage of VIES API on one of our project because of their API have some issues.
It's not related to valvat gem which does its work correctly. But I was thinking of having some little cache to avoid calling too many time VIES API when not required.
Since VAT validity does not change this often, I guess 1 or few hour of cache on a VAT number may not be risky.
I will take time to do a pull request, but I prefer to discuss here before doing some code.
One thing to have in mind is that this gem is not fully related to Rails and should work without it. So Valvat::Lookup objects may not be able to use Rails.cache (at least directly).
So I've thing about 2 ways of doing caching:
- On lookup
Having a generic cache object (ex: https://github.com/alexreisner/geocoder#caching) that could be use as proxy forRails.cache. - On validation only
Add acache: true(orcache: 2.hours) option in validator that may useRails.cache.
What do you think about it?
Metadata
Metadata
Assignees
Labels
No labels