In memory cache only stores data for the lifetime of the server. Once the app restarts, the cache is destroyed, and on startup, a new cache is created.
In order to keep a cache for a longer period of time, you can upgrade the azure function and turn on keep alive.
This really seems like a problem that would be better handled by a redis cache or some other dedicated service for caching, however.