You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**suggestion (testing):** Review and test caching logic for production environments
The new caching mechanism for blog data in production environments is a good performance improvement. Ensure that this change is thoroughly tested and that there's a strategy in place for cache invalidation when content is updated.
if (process.env.NODE_ENV === 'production') {
const cacheKey = `blog_content_${filePath}`;
const cachedContent = cache.get(cacheKey);
if (cachedContent) {
return cachedContent as ArticlesSection[];
}
const result = fileContents?.sections as ArticlesSection[];
cache.set(cacheKey, result, 3600); // Cache for 1 hour
return result;
}
Should we cache the files like this? I did a research and maybe we can set up more config for SSG?
The text was updated successfully, but these errors were encountered:
AndlerRL
changed the title
**suggestion (testing):** Review and test caching logic for production environments - catching strategy
suggestion (testing): Review and test caching logic for production environments - catching strategy
Aug 24, 2024
The new caching mechanism for blog data in production environments is a good performance improvement. Ensure that this change is thoroughly tested and that there's a strategy in place for cache invalidation when content is updated.
Originally posted by @sourcery-ai[bot] in #324 (comment)
Should we cache the files like this? I did a research and maybe we can set up more config for SSG?
The text was updated successfully, but these errors were encountered: