Auth0 JWT Response Times (Ruby)

I have an app (VueJS frontend and Rails 5.2 API). I’m using the JWT gem on the backend to authorize each API call.

I followed this tutorial:
https://auth0.com/docs/quickstart/backend/ruby/01-authorization

The problem is, this is adding 200ms+ of latency for each API call. I would be willing to deal with 10-50ms, but 200 is just too slow. I am wondering if this is normal, or if this is because I am running this in dev mode?

def self.verify(token)
JWT.decode(token, nil,
true, # Verify the signature of this token
algorithm: ‘RS256’,
iss: “https://clickflow.auth0.com/”,
verify_iss: true,
aud: ‘http://localhost:5000’,
verify_aud: true) do |header|
jwks_hash[header[‘kid’]]
end
end

Since this is called for every API call, this adds significant lag to my app. How can I speed this up?

200ms sounds way too long. The most overhead would probably be in fetching the Auth0 public key, as that requires an HTTP request to the Auth0 servers. That request should only happen once and then get cached. Is there a chance it doesn’t get cached in dev mode?