mirror of
https://github.com/jakejarvis/jarv.is.git
synced 2025-10-28 20:35:49 -04:00
fix sitemap.xml timeouts
This commit is contained in:
@@ -3,6 +3,13 @@ import { favicons } from "../lib/config/seo";
|
||||
import type { GetServerSideProps } from "next";
|
||||
|
||||
export const getServerSideProps: GetServerSideProps<Record<string, never>> = async (context) => {
|
||||
const { res } = context;
|
||||
|
||||
// https://developer.mozilla.org/en-US/docs/Web/Manifest#deploying_a_manifest
|
||||
res.setHeader("content-type", "application/manifest+json; charset=utf-8");
|
||||
// cache on edge for one week
|
||||
res.setHeader("cache-control", "public, max-age=0, s-maxage=604800, stale-while-revalidate");
|
||||
|
||||
const manifest = {
|
||||
name: config.siteName,
|
||||
short_name: config.siteDomain,
|
||||
@@ -37,12 +44,6 @@ export const getServerSideProps: GetServerSideProps<Record<string, never>> = asy
|
||||
display: "browser",
|
||||
start_url: "/",
|
||||
};
|
||||
const { res } = context;
|
||||
|
||||
// https://developer.mozilla.org/en-US/docs/Web/Manifest#deploying_a_manifest
|
||||
res.setHeader("content-type", "application/manifest+json; charset=utf-8");
|
||||
// cache on edge for one week
|
||||
res.setHeader("cache-control", "public, max-age=0, s-maxage=604800, stale-while-revalidate");
|
||||
|
||||
res.write(JSON.stringify(manifest));
|
||||
res.end();
|
||||
|
||||
Reference in New Issue
Block a user