Skip to content

Commit

Permalink
fix: quick links to countries are slow
Browse files Browse the repository at this point in the history
fix: increase area page cache time
  • Loading branch information
vnugent committed Dec 4, 2024
1 parent fc78a47 commit 6815634
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/app/(default)/area/[[...slug]]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import { PageWithCatchAllUuidProps, PageSlugType } from '@/js/types/pages'
/**
* Page cache settings
*/
export const revalidate = 300 // 5 mins
export const revalidate = 3600 // 1 hr
export const fetchCache = 'force-no-store' // opt out of Nextjs version of 'fetch'

/**
Expand Down
1 change: 1 addition & 0 deletions src/app/(default)/components/DesktopHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ const QuickLinks: React.FC = () => {
<Link
key={href}
href={href}
prefetch={false}
className='text-xs font-semibold text-primary/80 flex items-center whitespace-nowrap hover:underline hover:decoration-1 gap-1.5'
>
{icon}{label}
Expand Down
4 changes: 2 additions & 2 deletions src/components/media/Tag.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import clx from 'classnames'
import { EntityTag, TagTargetType } from '../../js/types'
import { OnDeleteCallback } from './TagList'
import { MouseEventHandler } from 'react'
import { getAreaPageFriendlyUrl } from '@/js/utils'
import { getAreaPageFriendlyUrl, getClimbPageFriendlyUrl } from '@/js/utils'

interface PhotoTagProps {
mediaId: string
Expand Down Expand Up @@ -68,7 +68,7 @@ export const resolver = (props: EntityTag): [string, string] | [null, null] => {
const { targetId: id, climbName, areaName, type } = props
switch (type) {
case TagTargetType.climb: {
return [`/climb/${id}`, climbName ?? '']
return [getClimbPageFriendlyUrl(id, climbName ?? ''), climbName ?? '']
}
case TagTargetType.area: {
return [getAreaPageFriendlyUrl(id, areaName), areaName]
Expand Down

0 comments on commit 6815634

Please sign in to comment.