sveltejs / sveltejs/kit

Add incremental static regeneration

Open
#661 75 comments 182 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

size:large
Dominant language
JavaScript
Stars
20.8k
Forks
2.3k
Avg merge
1d 16h
Merged PRs (30d)
156

Description

Overview

One of the best features of Next.js is incremental static regeneration. It would be great to have something similar to it.

https://nextjs.org/docs/basic-features/data-fetching#incremental-static-regeneration

The core features being:

  • Pages can be dynamically generated
  • Resulting page is cached for X time
  • After X time, the page is dynamically regenerated again

In the ideal world, there would also be some way to invalidate the cache. https://github.com/vercel/next.js/discussions/16488

As I understand Sveltekit, currently, this is not possible.

Proposed solution

Extend the prerender API with a revalidate parameter.

<script context="module">
	export const prerender = true;
	export const revalidate = 900; // 900 seconds, or 15 minutes
</script>

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked Next.js incremental static regeneration documentation and the SvelteKit RFC process, then inspect the existing prerender API. The work is done when prerendered pages can be regenerated after a configurable interval and the cache invalidation behavior is defined, implemented, and tested.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, next.js
Domain
web-dev
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.