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",
|
"name": "homepage",
|
||||||
"version": "1.64.0",
|
"version": "1.64.1",
|
||||||
"private": true,
|
"private": true,
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
import { getArchetypes, getArguments } from '$lib/data/apologetik';
|
import { getArchetypes, getArguments } from '$lib/data/apologetik';
|
||||||
import type { PageLoad } from './$types';
|
import type { PageLoad } from './$types';
|
||||||
|
|
||||||
export const load: PageLoad = async ({ parent, setHeaders }) => {
|
export const load: PageLoad = async ({ parent }) => {
|
||||||
setHeaders({ 'Cache-Control': 'public, max-age=300, s-maxage=3600, stale-while-revalidate=86400' });
|
|
||||||
const { lang } = await parent();
|
const { lang } = await parent();
|
||||||
const [archetypes, args] = await Promise.all([getArchetypes(lang), getArguments(lang)]);
|
const [archetypes, args] = await Promise.all([getArchetypes(lang), getArguments(lang)]);
|
||||||
return { archetypes, args };
|
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 { m as faithM, faithSlugFromLang, apologetikSlug, type FaithLang } from '$lib/js/faithI18n';
|
||||||
import type { PageLoad } from './$types';
|
import type { PageLoad } from './$types';
|
||||||
|
|
||||||
export const load: PageLoad = async ({ params, parent, setHeaders }) => {
|
export const load: PageLoad = async ({ params, parent }) => {
|
||||||
setHeaders({ 'Cache-Control': 'public, max-age=300, s-maxage=3600, stale-while-revalidate=86400' });
|
|
||||||
const parentData = await parent();
|
const parentData = await parent();
|
||||||
const lang = parentData.lang as FaithLang;
|
const lang = parentData.lang as FaithLang;
|
||||||
const [arg, archetypes, args] = await Promise.all([
|
const [arg, archetypes, args] = await Promise.all([
|
||||||
|
|||||||
+1
-2
@@ -7,8 +7,7 @@ import {
|
|||||||
} from '$lib/data/apologetik';
|
} from '$lib/data/apologetik';
|
||||||
import { resolveScriptureForLang } from '$lib/server/scriptureLookup';
|
import { resolveScriptureForLang } from '$lib/server/scriptureLookup';
|
||||||
|
|
||||||
export const load: PageServerLoad = async ({ parent, setHeaders }) => {
|
export const load: PageServerLoad = async ({ parent }) => {
|
||||||
setHeaders({ 'Cache-Control': 'public, max-age=300, s-maxage=3600, stale-while-revalidate=86400' });
|
|
||||||
const { lang } = await parent();
|
const { lang } = await parent();
|
||||||
const [voices, layers, args] = await Promise.all([
|
const [voices, layers, args] = await Promise.all([
|
||||||
getPosVoices(lang),
|
getPosVoices(lang),
|
||||||
|
|||||||
+1
-6
@@ -12,12 +12,7 @@ import { generateProArgArticleJsonLd } from '$lib/js/apologetikJsonLd';
|
|||||||
import { generateBreadcrumbJsonLd } from '$lib/js/breadcrumbJsonLd';
|
import { generateBreadcrumbJsonLd } from '$lib/js/breadcrumbJsonLd';
|
||||||
import { m as faithM, faithSlugFromLang, apologetikSlug, type FaithLang } from '$lib/js/faithI18n';
|
import { m as faithM, faithSlugFromLang, apologetikSlug, type FaithLang } from '$lib/js/faithI18n';
|
||||||
|
|
||||||
export const load: PageServerLoad = async ({ params, parent, setHeaders }) => {
|
export const load: PageServerLoad = async ({ params, parent }) => {
|
||||||
// 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' });
|
|
||||||
|
|
||||||
const parentData = await parent();
|
const parentData = await parent();
|
||||||
const lang = parentData.lang as FaithLang;
|
const lang = parentData.lang as FaithLang;
|
||||||
const [arg, voices, layers, args] = await Promise.all([
|
const [arg, voices, layers, args] = await Promise.all([
|
||||||
|
|||||||
Reference in New Issue
Block a user