What is the best practice for using ArcGIS Server tokens (generateToken) with the REST API? Should I request a new token for every request; or retain the token and request a new one when it nears expiration?
Generating a token is extremely quick. I always generate a new one for each request. I think this will eliminate trying a request, creating a exception because the token is expired, generate a new token, and then trying the request again.