cache browser
parent
cf5ac7cba9
commit
1ec9c9d20a
|
|
@ -19,9 +19,7 @@ export const handler = async (request, response, next) => {
|
||||||
response.setHeader("Content-Type", "application/pdf");
|
response.setHeader("Content-Type", "application/pdf");
|
||||||
response.send(pdf);
|
response.send(pdf);
|
||||||
};
|
};
|
||||||
reportData.configFunctions = configFunctions;
|
const ejsCallbackFunction = async (ejsError, ejsData) => {
|
||||||
reportData.dateTimeFunctions = dateTimeFunctions;
|
|
||||||
await ejs.renderFile(reportPath, reportData, {}, async (ejsError, ejsData) => {
|
|
||||||
if (ejsError) {
|
if (ejsError) {
|
||||||
return next(ejsError);
|
return next(ejsError);
|
||||||
}
|
}
|
||||||
|
|
@ -29,8 +27,14 @@ export const handler = async (request, response, next) => {
|
||||||
format: "letter",
|
format: "letter",
|
||||||
printBackground: true,
|
printBackground: true,
|
||||||
preferCSSPageSize: true
|
preferCSSPageSize: true
|
||||||
|
}, undefined, {
|
||||||
|
cacheBrowser: true,
|
||||||
|
remoteContent: false
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
});
|
};
|
||||||
|
reportData.configFunctions = configFunctions;
|
||||||
|
reportData.dateTimeFunctions = dateTimeFunctions;
|
||||||
|
await ejs.renderFile(reportPath, reportData, {}, ejsCallbackFunction);
|
||||||
};
|
};
|
||||||
export default handler;
|
export default handler;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue