sveltejs / sveltejs/kit

Preload redirected routes

Open
#11,573 0 comments 5 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Describe the problem

Currently when a link preloads a route that initiates a redirect through one of its server load functions, the subsequent route's code and data are not preloaded. This behavior leads to increased load times for users, as the code and data of links with redirects have not been loaded in the background when a navigation is triggered.

Describe the proposed solution

Preloading a route that issues a redirect should also trigger a preload of its subsequent route. This could be implemented either dynamically on the client side, by triggering another preload request whenever a redirect is encountered, or on the server side, by automatically executing load functions and including the data and code of the final destination in the redirect response.

Alternatives considered

No response

Importance

nice to have

Additional Information

No response

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 by tracing how route preloading handles server load redirects on the client and server. The change is complete when preloading a redirecting route also preloads the final destination's code and data; compare the client-side and server-side approaches described in the issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
web-dev
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.