Skip to content

Commit

Permalink
Try revalidating all pages after 24 hrs
Browse files Browse the repository at this point in the history
  • Loading branch information
kylegach committed Jul 23, 2024
1 parent dc6db25 commit 4fff312
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
3 changes: 3 additions & 0 deletions apps/addon-catalog/app/(home)/page.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import { fetchHomeData } from '../../lib/fetch-home-data';
import { Preview } from '../../components/preview';

// 60*60*24 = 24 hrs
export const revalidate = 86400;

export default async function Page() {
const {
popularAddons = [],
Expand Down
3 changes: 3 additions & 0 deletions apps/addon-catalog/app/(home)/tag/[...name]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ import { notFound } from 'next/navigation';
import { Preview } from '../../../../components/preview';
import { fetchTagDetailsData } from '../../../../lib/fetch-tag-details-data';

// 60*60*24 = 24 hrs
export const revalidate = 86400;

interface TagDetailsProps {
params: {
name: string[];
Expand Down
8 changes: 3 additions & 5 deletions apps/addon-catalog/app/[...addonName]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,15 @@ import { AddonHero } from '../../components/addon/addon-hero';
import { AddonSidebar } from '../../components/addon/addon-sidebar';
import { Highlight } from '../../components/highlight';

// 60*60*24 = 24 hrs
export const revalidate = 86400;

interface AddonDetailsProps {
params: {
addonName: string[];
};
}

// export async function generateStaticParams() {
// const addons = (await fetchAddonsData()) || [];
// return addons.map((name) => ({ params: { addonName: name?.split('/') } }));
// }

export default async function AddonDetails({ params }: AddonDetailsProps) {
// TODO: Better decoding?
const name = params.addonName.join('/').replace('%40', '@');
Expand Down

0 comments on commit 4fff312

Please sign in to comment.