transitive-bullshit / nextjs-notion-starter-kit

Deploy your own Notion-powered website in minutes with Next.js and Vercel.
https://transitivebullsh.it/nextjs-notion-starter-kit
MIT License
6.17k stars 5.24k forks source link

Large sitemaps time out on Vercel free tier #79

Open dbredvick opened 3 years ago

dbredvick commented 3 years ago

Summary: Because my Notion document is growing somewhat large, the sitemap request times out under Vercel's free tier (10 seconds).

Notion page: https://www.notion.so/dbredvick/Drew-tech-1e0b275c5ca44b4bbf5dc0e24017f593

CleanShot 2021-03-29 at 09 01 39

I'll be looking into fixing this on my blog, will contribute upstream when I have a reasonable fix.

dbredvick commented 3 years ago

As an initial fix, bumping the concurrency from concurrency: 4 to concurrency: 5 was sufficient for my blog in get-site-maps.ts.

transitive-bullshit commented 3 years ago

Thanks @dbredvick; WIP solution tracking here https://github.com/transitive-bullshit/nextjs-notion-starter-kit/pull/83

Mvbbb commented 3 years ago

I have the same issue, but "bumping the concurrency from concurrency: 4 to concurrency: 5" don't work for me. Then I tried to access sitemap.xml locally,but I got 404. image

image

dbredvick commented 3 years ago

I ultimately decided to start paying Vercel $20 a month to switch timeouts to 60 seconds. Well worth it for me as I host all my projects on Vercel.

transitive-bullshit commented 3 years ago

@Mvbbb can you comment on this issue with a link to your site.config.js so I can repro more easily?

@dbredvick nice — that's definitely one solution 😄

83 should provide a very solid speedup, but I don't have the time at the moment to push it over the finish line.

dbredvick commented 3 years ago

@transitive-bullshit I might be able to take a look at #83 over the weekend.

Mvbbb commented 3 years ago

@transitive-bullshit Sure。 https://github.com/Mvbbb/nextjs-notion-blog/blob/master/site.config.js

transitive-bullshit commented 2 years ago

I believe this should be fixed with the recent addition of optional redis caching for pathname to notion page ID lookups.

octrow commented 1 year ago

Unfortunately sitemap.xml generation outputs a 504 error. I read that this is due to a 10 second limit on the free plan from vercel, but has been resolved with the redis labs update. I have caching connected via redis labs (free plan), I checked the operation via monitor in redis-cli as I thought I might have a connection problem, but I can see the image caching working.

I've been reading the @keyvhq/redis documentation and googling solutions and similar errors, but unfortunately haven't been able to find any solutions in the last 5 days.

Perhaps the problem is related to the fact that many pages have manually (via table in notion) changed Slug.

Error page: https://www.boklanov.ru/sitemap.xml