Cache api response data for a virtual page programatically

somewhat related post: Check if virtual page exists since it shows code of how to query an api and store that in a cache