Skip to content

Commit

Permalink
Index page not updating recent tags and edits (#1000)
Browse files Browse the repository at this point in the history
* fix: set cache expiration at page component
  • Loading branch information
vnugent authored Oct 29, 2023
1 parent 42ddf07 commit 7d3cf05
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 11 deletions.
5 changes: 0 additions & 5 deletions src/app/components/RecentEdits.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,6 @@ import { ArrowRightIcon } from '@heroicons/react/24/outline'
import { getChangeHistoryServerSide } from '@/js/graphql/contribAPI'
import { ChangesetCard } from '@/components/edit/RecentChangeHistory'

/**
* Cache time in seconds
*/
export const revalidate = 300

/**
* Show most recent edits
*/
Expand Down
5 changes: 0 additions & 5 deletions src/app/components/RecentTags.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
import { RecentImageCard } from '@/components/home/RecentMediaCard'
import { getMediaForFeed } from '@/js/graphql/api'

/**
* Cache time in seconds
*/
export const revalidate = 300

/**
* Horizontal gallery of recent images with tags
*/
Expand Down
5 changes: 5 additions & 0 deletions src/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ import { RecentEdits, RecentEditsSkeleton } from './components/RecentEdits'
import { RecentTags } from './components/RecentTags'
import { USAToC } from './components/USAToC'

/**
* Cache duration in seconds
*/
export const revalidate = 300

/**
* Root home page
*/
Expand Down
2 changes: 1 addition & 1 deletion src/js/graphql/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export const getMediaForFeed = async (maxUsers: number, maxFiles: number): Promi
maxUsers,
maxFiles
},
notifyOnNetworkStatusChange: true
fetchPolicy: 'network-only'
})

if (Array.isArray(rs.data?.getMediaForFeed)) {
Expand Down

1 comment on commit 7d3cf05

@vercel
Copy link

@vercel vercel bot commented on 7d3cf05 Oct 29, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.