Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions pages/articles/[...slug].js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export default function Home({ article, hrefLang }) {
);
}

export async function getStaticPaths(context) {
export async function getServerSidePaths(context) {
const multiLanguage = isMultiLanguage(context.locales);
// TODO - locale increases the complexity enough here that creating a usePaths
// hook would be a good idea.
Expand Down Expand Up @@ -92,7 +92,7 @@ export async function getStaticPaths(context) {
};
}

export async function getStaticProps(context) {
export async function getServerSideProps(context) {
const multiLanguage = isMultiLanguage(context.locales);
// TODO - determine apiBase from environment variables
const store = new DrupalState({
Expand Down Expand Up @@ -184,11 +184,18 @@ export async function getStaticProps(context) {
});
});

context.res.setHeader(
'Cache-Control',
'public, s-maxage=10, stale-while-revalidate=6000'
);

return {
props: {
article,
hrefLang,
revalidate: 60,
//
// I'm not sure if this property does anything for SSR.
revalidate: 5,
},
};
}
196 changes: 0 additions & 196 deletions pages/recipes/[...slug].js

This file was deleted.

144 changes: 0 additions & 144 deletions pages/recipes/index.js

This file was deleted.