Skip to content
This repository has been archived by the owner on Aug 7, 2024. It is now read-only.

[OTHER] Improved management of ISR revalidation intervals using a configuration file #7142

Closed
badrivlog opened this issue May 23, 2023 · 3 comments · Fixed by #7193
Closed
Assignees
Labels
💻 aspect: code undefined ✨ goal: improvement undefined 🔢 points: 3 undefined 🏁 status: ready for dev You can asked for this issue to be assigned (if not already assigned)

Comments

@badrivlog
Copy link
Contributor

What would you like to share?

Currently, Linkfree uses Incremental Static Regeneration (ISR) for some pages,
managing the revalidate values for different pages becomes crucial for customization and maintainability. I propose implementing a configuration file specifically for managing ISR revalidation intervals to enhance code organisation and provide more flexibility.

Benefits

  • Centralized configuration: A dedicated configuration file consolidates all revalidate values in one place, providing a clear overview of regeneration intervals for different pages.
  • Easy customization: The configuration file allows for simple adjustments of the regeneration intervals without modifying the code directly, offering flexibility as requirements evolve.
  • Separation of concerns: Separating revalidate values from page-specific logic ensures a clear distinction between regeneration configuration and data fetching/rendering, improving code modularity.
  • Scalability and maintainability: As the application expands with additional pages, a configuration file simplifies updates and modifications, contributing to code maintainability.
  • Dynamic values: The configuration file approach supports dynamic revalidate values, enabling fetching from external sources, using environment variables, or calculating intervals based on conditions.
  • Collaboration and team workflows: With a configuration file, developers can easily collaborate and make changes to regeneration intervals, ensuring consistency across the project.

Changes proposed

  • Create a configuration file (e.g., isr.js) to store revalidate values for different pages.
  • Import the configuration file into the getStaticProps function for each page and utilize the appropriate revalidate value from the configuration object.
  • Update the configuration file as needed to reflect the desired revalidate intervals for each page.

This enhancement will improve the management of ISR revalidation intervals, leading to a more organized codebase, easier customization, and streamlined collaboration among team members.

Additional information

Happy to work on this 👍

Thanks

@badrivlog badrivlog added the 🚦 status: awaiting triage Waiting for maintainers to verify (please do not start work on this yet) label May 23, 2023
@github-actions
Copy link
Contributor

To reduce notifications, issues are locked until they are https://github.com/EddieHubCommunity/LinkFree/labels/%F0%9F%8F%81%20status%3A%20ready%20for%20dev and to be assigned. You can learn more in our contributing guide https://github.com/EddieHubCommunity/LinkFree/blob/main/CONTRIBUTING.md

@github-actions github-actions bot locked and limited conversation to collaborators May 23, 2023
@SaraJaoude SaraJaoude added 💻 aspect: code undefined 🏁 status: ready for dev You can asked for this issue to be assigned (if not already assigned) 🔢 points: 3 undefined and removed 🚦 status: awaiting triage Waiting for maintainers to verify (please do not start work on this yet) labels May 24, 2023
@SaraJaoude
Copy link
Member

@badrivlog I have updated the labels so this shows status: ready for dev and I have assigned this to you

@eddiejaoude
Copy link
Member

Thanks for the suggestion 👍 We could probably using the existing app config file config/app.json and add a new object to it with...

{
   // ...
   isr: {
      
   }
}

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
💻 aspect: code undefined ✨ goal: improvement undefined 🔢 points: 3 undefined 🏁 status: ready for dev You can asked for this issue to be assigned (if not already assigned)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants