Add Cache-Control max-age headers globally
This commit is contained in:
@@ -4,7 +4,7 @@ import { fetchAPI } from '$utils/api'
|
||||
import { PUBLIC_PREVIEW_COUNT } from '$env/static/public'
|
||||
|
||||
|
||||
export const load: PageServerLoad = async () => {
|
||||
export const load: PageServerLoad = async ({ setHeaders }) => {
|
||||
try {
|
||||
const res = await fetchAPI(`query {
|
||||
locations: location (filter: { status: { _eq: "published" }}) {
|
||||
@@ -87,6 +87,8 @@ export const load: PageServerLoad = async () => {
|
||||
}`)
|
||||
|
||||
if (res) {
|
||||
setHeaders({ 'Cache-Control': 'public, max-age=3600' })
|
||||
|
||||
const { data: { countPhotos, countLocations, countCountries, ...rest }} = res
|
||||
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user