Closed yoniamir closed 6 years ago
Thanks for reporting. I'll try to take a look this weekend.
Btw, have you written any code which exposes the problem in a test and fixed it? Feel free to submit a pull request if you have and I'll look at it.
Sorry, I've already changed so I don't have it handy- but if you put a log printing inside of client_cache.rb:16
you'll see that it gets called every new request to the server.
It's also easy to see in the rails logs, the cache key being written is different from the cache key being read.
Google distance matrix api has become pretty expensive... :/
Hi,
I tried to reproduce it in tests, but I wasn't able to. Please take a look around here https://github.com/Skalar/google_distance_matrix/blob/80009225b259afbddbb52b0718195727c1544b03/spec/lib/google_distance_matrix/matrix_spec.rb#L141-L181
Are you able to write a test here which reproduces your reporting? Maybe you have a specific configuration or something? Please fork and write a test which exposes the situation.
Thank you.
Please feel free to reopen if you provide a branch with some failing spec which exemplifies it :)
When I tried using the cache option provided by this neat gem, I was looking at my web requests and realized that requests are not being cached. Digging in, it appears that the write key and the read key to the cache differ. This happens because of the default filtering of the
filter_parameters_in_logged_url
setting, which excludeskey
from being written in the cache but is read from the cache, resulting in never working cache.Setting the
config.filter_parameters_in_logged_url = []
for example, fixes the caching problem. The obscuring does not work anyway since it's being used to read from the cache.