Skip to content

[DEV-3615] Fix Metadata Cache to Support Locale#2025

Merged
marcobottaro merged 7 commits intomainfrom
DEV-3615-fix-metadata-cache-to-support-locale
Feb 13, 2026
Merged

[DEV-3615] Fix Metadata Cache to Support Locale#2025
marcobottaro merged 7 commits intomainfrom
DEV-3615-fix-metadata-cache-to-support-locale

Conversation

@Sebastiano-Bertolin
Copy link
Collaborator

This pull request refactors the metadata caching logic in the nextjs-website app to use a more generic, type-safe approach and to improve locale support. The previous implementation with separate cache variables and timestamps for each metadata type is replaced by a unified, generic cache structure and helper function. This makes the codebase easier to maintain and extend, especially when handling multiple locales and metadata categories.

List of Changes

Caching infrastructure refactor:

  • Introduced a generic MetadataCacheItem<T> type and a unified metadataCache array to replace separate cache variables and timestamps for each metadata category. This centralises and simplifies cache management.
  • Added a new generic helper function fetchMetadataWithCache to handle cache lookups, TTL checks, and cache updates for all metadata types, reducing code duplication and improving maintainability.

Metadata fetching improvements:

  • Updated getGuidesMetadata, getSolutionsMetadata, getReleaseNotesMetadata, and getSoapApiMetadata to use the new generic caching function, ensuring consistent cache behaviour and improved locale support across all metadata fetches.

Motivation and Context

How Has This Been Tested?

Screenshots (if appropriate):

Types of changes

  • Chore (nothing changes by a user perspective)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

@changeset-bot
Copy link

changeset-bot bot commented Feb 13, 2026

🦋 Changeset detected

Latest commit: 42bccba

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
nextjs-website Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions
Copy link
Contributor

github-actions bot commented Feb 13, 2026

Jira Pull Request Link

This Pull Request refers to the following Jira issue DEV-3615

@marcobottaro marcobottaro merged commit 2526507 into main Feb 13, 2026
16 checks passed
@marcobottaro marcobottaro deleted the DEV-3615-fix-metadata-cache-to-support-locale branch February 13, 2026 16:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants