I have this JSON object stored in a file called object.json.
Every time the method getAlbum()
is called during an HTTP request, the JSON object is cached because it is imported at the top of the page.
Is there a way to create a new instance of the object to clear the JSON cache each time?
Since the JSON object has many fields and deep nested structure, simply creating a new Object()
won't work.
const albumReportJSON = require('./album.report.json');
const getAlbum = async(ctx) => {
const value = albumReportJSON;
// processing...
}