Setting a 24 hour cache on API requests if requested
(cherry picked from commit 29cf5f677ddb53392763464ff0b03458b89d6523)