diff --git a/docusaurus.config.js b/docusaurus.config.js index 640f3b36..2ced3fc3 100644 --- a/docusaurus.config.js +++ b/docusaurus.config.js @@ -17,7 +17,7 @@ const config = { baseUrlIssueBanner: false, favicon: "/images/favicon.webp", organizationName: "QuestDB", - staticDirectories: ['assets', 'images', 'static'], + staticDirectories: ['static'], projectName: "questdb", customFields, onBrokenLinks: "warn", @@ -83,28 +83,6 @@ const config = { ], }, ], - function (context, options) { - return { - name: 'development-redirects', - configureWebpack(config, isServer, utils) { - if (process.env.NODE_ENV === 'development') { - return { - devServer: { - onBeforeSetupMiddleware: function (devServer) { - devServer.app.get('*', function (req, res, next) { - // If path doesn't start with /docs, redirect to Next.js - if (!req.path.startsWith('/docs/')) { - return res.redirect(`http://localhost:3000${req.path}`) - } - next() - }) - } - } - } - } - } - } - } ].filter(Boolean), themeConfig: { diff --git a/netlify.toml b/netlify.toml index 4bfe76b0..75016ed3 100644 --- a/netlify.toml +++ b/netlify.toml @@ -1,7 +1,21 @@ [[plugins]] package = "netlify-plugin-cache" [plugins.inputs] -paths = ["node_modules/.cache"] +paths = [ + "node_modules/.cache", + ".cache", + ".docusaurus", + "build", + "node_modules" +] + +[build] +command = "npm run build" +publish = "build" + +[build.environment] +NODE_VERSION = "18" +NODE_OPTIONS = "--max_old_space_size=4096" [[redirects]] from = "/docs/reference/sql/backup/" @@ -637,3 +651,18 @@ X-Frame-Options = "SAMEORIGIN" X-XSS-Protection = "0" X-Content-Type-Options = "nosniff" Content-Security-Policy = "frame-src 'self' app.netlify.com *.demo.questdb.io *.questdb.io www.youtube.com www.slideshare.net forms.hsforms.com;" + +[[headers]] +for = "/static/*" +[headers.values] +Cache-Control = "public, max-age=31536000, immutable" + +[[headers]] +for = "*.js" +[headers.values] +Cache-Control = "public, max-age=31536000, immutable" + +[[headers]] +for = "*.css" +[headers.values] +Cache-Control = "public, max-age=31536000, immutable"