New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Caching #167
Comments
The thing here is that the status of a call or text can change when you look it up. A call, for example, could have a different status each time you request it during the space of time you may be interested in it. Similarly, lists of calls and texts are changing all the time as more come in. It's probably better to cache the list or the call or text on your end to deal with your use case. |
Sorry I wrote this from a mobile phone let me provide more context. The ruby API doesn't make it easy to access a call without first accessing an account. The status of an account doesn't change very often. Assuming I have the master account sid and token in variables "@sid" and "@sec" client = Twilio::REST::Client.new @sid, @sec
@call = client.accounts.get(params[:AccountSid]).calls.get(params[:CallSid]) The downside here is I had to fetch the sub account adding an extra request to get the call... I am wondering if maybe there is a better pattern to given the client has master key/sec to fetch calls within a sub account via the ruby interface... From the REST api directly this is easily over come... |
The call to In fact, the call to Are you seeing different results in your testing? |
Hey @taf2, did you find that your client was acting differently or do you think this level of caching is ok? Thanks |
@philnash looks like it is all okay. I had to modify my usage slightly and now it is all good. |
Awesome, just wanted to make sure. Give us a shout on here or on email if you have any other ideas or need pointing in the right direction. Cheers! |
Is it possible to cache requests to get references to accounts when the only thing that will be done is get a list of calls or lookup a call or text....
The text was updated successfully, but these errors were encountered: