All changes

This commit is contained in:
Andras Schmelczer 2026-03-14 21:36:00 +00:00
parent 593f380581
commit 49f7ec2f5a
60 changed files with 1783 additions and 679 deletions

View file

@ -50,6 +50,10 @@ export class ScreenshotCache {
normalized.tab = params.get('tab')!;
}
if (params.get('path')) {
normalized.path = params.get('path')!;
}
const input = JSON.stringify(normalized);
const hash = createHash('sha256').update(input).digest('hex').substring(0, 16);
return hash;

View file

@ -53,7 +53,12 @@ app.get('/screenshot', async (req, res) => {
}
}
// Extract path param (used for non-root pages like /invite/CODE)
const pagePath = typeof req.query.path === 'string' && req.query.path ? req.query.path : '/';
if (pagePath !== '/') qs.set('path', pagePath);
const cacheKey = cache.buildKey(qs);
qs.delete('path');
// Check cache first
const cached = cache.get(cacheKey);
@ -67,7 +72,7 @@ app.get('/screenshot', async (req, res) => {
// Build the URL for the frontend in screenshot mode
qs.set('screenshot', '1');
const url = `${APP_URL}/?${qs}`;
const url = `${APP_URL}${pagePath}?${qs}`;
console.log(`Taking screenshot: ${url}`);
const png = await takeScreenshot(url);