parent
3e9a22e788
commit
8a8c141fbe
6 changed files with 14 additions and 16 deletions
|
|
@ -2,14 +2,11 @@ import type { LayoutServerLoad } from './$types';
|
|||
import { dev } from '$app/environment';
|
||||
|
||||
export const load: LayoutServerLoad = async (event) => {
|
||||
// Only set Cache-Control if not already set
|
||||
if (!event.request.headers.get('cache-control')) {
|
||||
event.setHeaders({
|
||||
'Cache-Control': dev
|
||||
? 'no-cache'
|
||||
: 'private, max-age=30'
|
||||
});
|
||||
}
|
||||
event.setHeaders({
|
||||
'Cache-Control': dev
|
||||
? 'no-cache'
|
||||
: 'private, max-age=30'
|
||||
});
|
||||
|
||||
// Use the user data already fetched and processed in hooks
|
||||
return {
|
||||
|
|
|
|||
1
website/src/routes/+layout.ts
Normal file
1
website/src/routes/+layout.ts
Normal file
|
|
@ -0,0 +1 @@
|
|||
export const ssr = false;
|
||||
|
|
@ -16,5 +16,5 @@ export async function GET(event) {
|
|||
route: { id: "/api/hopium/questions/[id]" }
|
||||
};
|
||||
|
||||
return await getHopiumQuestion(hopiumEvent as any);
|
||||
return await getHopiumQuestion(hopiumEvent);
|
||||
}
|
||||
|
|
|
|||
Reference in a new issue