Skip to content

perf: SWR cache, skeleton loading, lazy-load maps [closes #336]#373

Merged
zigzagdev merged 3 commits into
mainfrom
chore/improve-loading-speed
May 22, 2026
Merged

perf: SWR cache, skeleton loading, lazy-load maps [closes #336]#373
zigzagdev merged 3 commits into
mainfrom
chore/improve-loading-speed

Conversation

@zigzagdev
Copy link
Copy Markdown
Owner

Summary

Note: image optimization (#332) was dropped after discovering thumbnail_url is a document URL that 403s under aggressive loading. Reverted to simple loading="lazy".

Test plan

  • Top page: navigating back to a page shows content instantly (cache hit)
  • Search results: switching pages shows skeleton then content
  • Detail page map loads lazily with pulse skeleton fallback
  • Top page map loads lazily with pulse skeleton fallback

🤖 Generated with Claude Code

zigzagdev and others added 3 commits May 22, 2026 09:37
…ls [closes #333] (#368)

* perf: create api-cache utility with TTL-based get/set

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* perf: apply SWR cache to useTopPage — serve stale data instantly, revalidate in background

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* perf: apply SWR cache to useHeritageSearchQuery keyed by serialized search params

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
* perf: create api-cache utility with TTL-based get/set

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* perf: apply SWR cache to useTopPage — serve stale data instantly, revalidate in background

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* perf: apply SWR cache to useHeritageSearchQuery keyed by serialized search params

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* perf(card): add isPriority prop — eager loading and fetchpriority for above-fold images

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* perf(list): pass isPriority to first 3 cards in HeritageList

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* perf(search): pass isPriority to first 3 cards in SearchResultsPage

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* perf: create HeritageCardSkeleton component matching thumbnail card dimensions

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* perf(list): add isLoading prop to HeritageList — show skeleton grid while fetching

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* perf(search): add isLoading prop to SearchResultsPage — show skeleton grid while fetching

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* perf(container): remove Loading… early return from TopPageContainer — pass isLoading to HeritageList

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* perf(container): pass isLoading to SearchResultsPage in SearchHeritageResultsContainer

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
…closes #331] (#372)

* perf: create api-cache utility with TTL-based get/set

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* perf: apply SWR cache to useTopPage — serve stale data instantly, revalidate in background

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* perf: apply SWR cache to useHeritageSearchQuery keyed by serialized search params

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* perf(card): add isPriority prop — eager loading and fetchpriority for above-fold images

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* perf(list): pass isPriority to first 3 cards in HeritageList

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* perf(search): pass isPriority to first 3 cards in SearchResultsPage

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* perf: create HeritageCardSkeleton component matching thumbnail card dimensions

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* perf(list): add isLoading prop to HeritageList — show skeleton grid while fetching

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* perf(search): add isLoading prop to SearchResultsPage — show skeleton grid while fetching

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* perf(container): remove Loading… early return from TopPageContainer — pass isLoading to HeritageList

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* perf(container): pass isLoading to SearchResultsPage in SearchHeritageResultsContainer

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* perf(top): lazy-load Map component with React.lazy and Suspense pulse fallback

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* perf(detail): lazy-load DetailHeritageMap with React.lazy and Suspense pulse fallback

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix(card): remove isPriority/fetchPriority/eager loading — caused 403 on UNESCO image URLs

fetchPriority="high" and loading="eager" triggered rate-limiting on UNESCO's
document server. Revert to loading="lazy" for all images. Keep width, height,
and decoding="async" for CLS prevention.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix(card): revert image dimension attrs added for #332

Drop decoding="async", width/height hints — image optimization issue
is being closed without implementation.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Copy link
Copy Markdown
Owner Author

@zigzagdev zigzagdev left a comment

Choose a reason for hiding this comment

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

ok 🌱

@zigzagdev zigzagdev merged commit 440a325 into main May 22, 2026
1 check passed
@zigzagdev zigzagdev deleted the chore/improve-loading-speed branch May 22, 2026 00:39
zigzagdev added a commit that referenced this pull request May 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant