fix(apologetik): drop duplicate Cache-Control in child loads
Layout already sets Cache-Control; SvelteKit throws when the same header is set twice in the load chain, 500ing /glaube/apologetik/pro and the parallel routes.
This commit is contained in:
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "homepage",
|
||||
"version": "1.64.0",
|
||||
"version": "1.64.1",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import { getArchetypes, getArguments } from '$lib/data/apologetik';
|
||||
import type { PageLoad } from './$types';
|
||||
|
||||
export const load: PageLoad = async ({ parent, setHeaders }) => {
|
||||
setHeaders({ 'Cache-Control': 'public, max-age=300, s-maxage=3600, stale-while-revalidate=86400' });
|
||||
export const load: PageLoad = async ({ parent }) => {
|
||||
const { lang } = await parent();
|
||||
const [archetypes, args] = await Promise.all([getArchetypes(lang), getArguments(lang)]);
|
||||
return { archetypes, args };
|
||||
|
||||
+1
-2
@@ -5,8 +5,7 @@ import { generateBreadcrumbJsonLd } from '$lib/js/breadcrumbJsonLd';
|
||||
import { m as faithM, faithSlugFromLang, apologetikSlug, type FaithLang } from '$lib/js/faithI18n';
|
||||
import type { PageLoad } from './$types';
|
||||
|
||||
export const load: PageLoad = async ({ params, parent, setHeaders }) => {
|
||||
setHeaders({ 'Cache-Control': 'public, max-age=300, s-maxage=3600, stale-while-revalidate=86400' });
|
||||
export const load: PageLoad = async ({ params, parent }) => {
|
||||
const parentData = await parent();
|
||||
const lang = parentData.lang as FaithLang;
|
||||
const [arg, archetypes, args] = await Promise.all([
|
||||
|
||||
+1
-2
@@ -7,8 +7,7 @@ import {
|
||||
} from '$lib/data/apologetik';
|
||||
import { resolveScriptureForLang } from '$lib/server/scriptureLookup';
|
||||
|
||||
export const load: PageServerLoad = async ({ parent, setHeaders }) => {
|
||||
setHeaders({ 'Cache-Control': 'public, max-age=300, s-maxage=3600, stale-while-revalidate=86400' });
|
||||
export const load: PageServerLoad = async ({ parent }) => {
|
||||
const { lang } = await parent();
|
||||
const [voices, layers, args] = await Promise.all([
|
||||
getPosVoices(lang),
|
||||
|
||||
+1
-6
@@ -12,12 +12,7 @@ import { generateProArgArticleJsonLd } from '$lib/js/apologetikJsonLd';
|
||||
import { generateBreadcrumbJsonLd } from '$lib/js/breadcrumbJsonLd';
|
||||
import { m as faithM, faithSlugFromLang, apologetikSlug, type FaithLang } from '$lib/js/faithI18n';
|
||||
|
||||
export const load: PageServerLoad = async ({ params, parent, setHeaders }) => {
|
||||
// Pure static content — long-form prose with no per-user state. Cache aggressively
|
||||
// at the edge so crawlers (and casual readers) get sub-50ms TTFB. Logged-in users
|
||||
// still get fresh server-rendered pages because most reverse proxies vary on cookies.
|
||||
setHeaders({ 'Cache-Control': 'public, max-age=300, s-maxage=3600, stale-while-revalidate=86400' });
|
||||
|
||||
export const load: PageServerLoad = async ({ params, parent }) => {
|
||||
const parentData = await parent();
|
||||
const lang = parentData.lang as FaithLang;
|
||||
const [arg, voices, layers, args] = await Promise.all([
|
||||
|
||||
Reference in New Issue
Block a user