ipad: Avoid caching of generated image

This commit is contained in:
Adam Goldsmith 2023-11-03 20:22:29 -04:00
parent c99ad19bba
commit c1e05a5605
2 changed files with 9 additions and 0 deletions

View File

@ -29,6 +29,14 @@ app.get('/ipad.png', async (req, res) => {
});
const screenshot = await puppet_page.screenshot();
await puppet_page.close();
// Disable caching
res.setHeader(
'Cache-Control',
'no-store, no-cache, must-revalidate, proxy-revalidate'
);
res.setHeader('Expires', '0');
res.send(screenshot);
});

View File

@ -46,6 +46,7 @@ function refresh() {
'viewport',
`${window.innerWidth}x${window.innerHeight}x${window.devicePixelRatio}`
);
url.hash = String(new Date().getTime());
const urlParams = new URLSearchParams(window.location.search);
if (urlParams.has('tool')) {