Skip to content

Commit

Permalink
Extend static images cache (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
BartoszJarocki authored Aug 20, 2022
1 parent fd3778a commit d7e9318
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions next.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,22 @@
/** @type {import('next').NextConfig} */

const ONE_YEAR_SECONDS = 60 * 60 * 24 * 365;
const CACHE_CONTROL_HEADER = {
key: "Cache-Control",
value: `public, max-age=${ONE_YEAR_SECONDS}, immutable`,
};

const nextConfig = {
reactStrictMode: true,
swcMinify: true,
}
headers: async () => {
return [
{
source: "/img/:path*",
headers: [CACHE_CONTROL_HEADER],
},
];
},
};

module.exports = nextConfig
module.exports = nextConfig;

1 comment on commit d7e9318

@vercel
Copy link

@vercel vercel bot commented on d7e9318 Aug 20, 2022

Choose a reason for hiding this comment

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

Please sign in to comment.