Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DO NOT MERGE] chore: FE caching (Redis) #525

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
Open

Conversation

8lane
Copy link
Contributor

@8lane 8lane commented Oct 8, 2024

Description

  • Remove cross-fetch
  • Restore Next's data cache for all requests except WHA requests
  • Update Next.js to 14.2.14
  • Add React 19 cache and parallel requests in root layout, homepage and dynamic page renderer
  • Remove needless error-boundary (suspense creates a boundary) from WHA + add ssr: false flag for dynamic import

Copy link

github-actions bot commented Oct 8, 2024

Unit tests coverage

Lines Statements Branches Functions
Coverage: 96%
95.07% (1719/1808) 85.9% (390/454) 96.61% (257/266)
Tests Skipped Failures Errors Time
463 0 💤 0 ❌ 0 🔥 15.279s ⏱️

@8lane 8lane marked this pull request as ready for review October 8, 2024 14:06

const globalBanner = await getGlobalBanner()
const getBanner = cache(getGlobalBanner)
const getFlag = cache(getFeatureFlag)
Copy link
Contributor

Choose a reason for hiding this comment

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

What does the workflow for this look like when we wanna switch a flag in the FE, is it something like:

  • Switch flag
  • Flush caches
  • Restart containers

But what if the flag value is cached in the frontend cache between steps 1 and 2? Does that mean when we flush caches, the CDN crawler will hit the frontend showing the stale value?

Copy link
Contributor

Choose a reason for hiding this comment

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

Arguably the crawler always fills the redis cache first so there would be enough time between the 2. So maybe this is okay

A-Ashiq
A-Ashiq previously approved these changes Oct 8, 2024
Copy link

sonarcloud bot commented Oct 10, 2024

@8lane 8lane changed the title fix: performance improvements [DO NOT MERGE] fix: performance improvements Oct 11, 2024
@8lane 8lane changed the title [DO NOT MERGE] fix: performance improvements [DO NOT MERGE] chore: FE caching (Redis) Oct 17, 2024
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.

2 participants