mirror of
https://github.com/ershisan99/www.git
synced 2026-01-29 05:22:04 +00:00
image optimizations
This commit is contained in:
@@ -13,6 +13,18 @@ const config = {
|
||||
images: {
|
||||
loader: 'custom',
|
||||
loaderFile: './image-loader.js',
|
||||
// Set minimumCacheTTL to a high value to ensure Next.js doesn't invalidate the cache too early
|
||||
minimumCacheTTL: 60 * 60 * 24 * 365, // 1 year in seconds
|
||||
},
|
||||
// Generate a unique build ID for each build if not provided by the environment
|
||||
// This will be used for cache invalidation in the image loader
|
||||
generateBuildId: async () => {
|
||||
// Use existing build ID if available (e.g., from CI/CD)
|
||||
if (process.env.BUILD_ID) {
|
||||
return process.env.BUILD_ID
|
||||
}
|
||||
// Otherwise, use a timestamp
|
||||
return `build-${Date.now()}`
|
||||
},
|
||||
}
|
||||
const withNextIntl = createNextIntlPlugin()
|
||||
|
||||
Reference in New Issue
Block a user