Explanation - If we don't save the cache in file and let it store in memory, it will later cause server loads because as currently we are storing the cache in in memory which will flushed every time we restart our server.
Things need to be done
Create a file and save the data in JSON format
Create a function which on server restart automatically read the file and seed the data in cache again to prevent from server db load
Also make scheduler which will update the file data on cache expiry and be in sync with cache
Explanation - If we don't save the cache in file and let it store in memory, it will later cause server loads because as currently we are storing the cache in in memory which will flushed every time we restart our server.
Things need to be done