Skip to content

Commit

Permalink
Merge pull request #4166 from dfe-analytical-services/EES-4389-revert…
Browse files Browse the repository at this point in the history
…-nextjs-page-caching

EES-4389 - reverting Next.js page caching changes
  • Loading branch information
duncan-at-hiveit authored Jul 10, 2023
2 parents 5a500c6 + 83c83da commit b714962
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import { logEvent } from '@frontend/services/googleAnalyticsService';
import glossaryService from '@frontend/services/glossaryService';
import classNames from 'classnames';
import orderBy from 'lodash/orderBy';
import { GetStaticPaths, GetStaticProps, NextPage } from 'next';
import { GetServerSideProps, NextPage } from 'next';
import React from 'react';
import VisuallyHidden from '@common/components/VisuallyHidden';
import ScrollableContainer from '@common/components/ScrollableContainer';
Expand Down Expand Up @@ -571,11 +571,13 @@ const PublicationReleasePage: NextPage<Props> = ({ release }) => {
);
};

export const getStaticProps: GetStaticProps<Props> = async ({ params }) => {
export const getServerSideProps: GetServerSideProps<Props> = async ({
query,
}) => {
const {
publication: publicationSlug,
release: releaseSlug,
} = params as Dictionary<string>;
} = query as Dictionary<string>;

const release = await (releaseSlug
? publicationService.getPublicationRelease(publicationSlug, releaseSlug)
Expand All @@ -585,14 +587,6 @@ export const getStaticProps: GetStaticProps<Props> = async ({ params }) => {
props: {
release,
},
revalidate: process.env.APP_ENV === 'Local' ? 2 : 10,
};
};

export const getStaticPaths: GetStaticPaths = async () => {
return {
paths: [],
fallback: 'blocking',
};
};

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
export {
default,
getStaticProps,
getStaticPaths,
getServerSideProps,
} from '@frontend/modules/find-statistics/PublicationReleasePage';
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
export {
default,
getStaticProps,
getStaticPaths,
getServerSideProps,
} from '@frontend/modules/find-statistics/PublicationReleasePage';

0 comments on commit b714962

Please sign in to comment.