Skip to content
Skillpedia
Websites & UI (frontend)75k · #2905

js-redirects

What it does

This skill finds pages that redirect using JavaScript and suggests server-side redirects instead. It is for developers who want faster, search-friendly navigation.

When to use it

  • ✓When a page loads and then sends visitors elsewhere with a script.
  • ✓When you move pages and redirects feel slow.
  • ✓When search engines seem to struggle with your redirects.

Skill link

https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/js-redirects/SKILL.md

Copy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.

How to use

The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.

Ready-to-paste message

Use this skill to help me: https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/js-redirects/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
Want your AI to find skills like this on its own?Install the free Skillpedia MCP: one line, and it searches 15,000+ skills before each task.Install in 1 minute →

Example of what to ask your AI

“Can you replace the JavaScript redirects on my site with proper server redirects?”

5 new skills a week. 1 minute to read.

How it works

The agent searches the code for window.location redirects and suggests moving them to 301 or 302 rules in the web server or edge configuration.

Technical content (original SKILL.md)

Original text by the author, straight from GitHub.

Avoid JavaScript-based redirects

JavaScript redirects force an additional round-trip after the initial page load, significantly increasing the time users spend waiting for content.

Quick Reference

  • Use 301 or 302 server-side redirects instead of window.location
  • JS redirects delay page load as the browser must first download and execute the script
  • Client-side redirects can negatively impact SEO and indexability

Check

Check the project for instances where JavaScript is being used for page-level redirects (e.g., window.location).

Fix

Replace JavaScript-based redirects with server-side 301 or 302 redirects in your web server or edge configuration.

Explain

Explain why server-side redirects are faster and more SEO-friendly than client-side JavaScript redirects.

Code Review

Review the routes, assets, and loading behavior that affect Avoid JavaScript-based redirects. Flag exact files, requests, or rendering steps that add unnecessary network, CPU, or layout cost, and describe the measurement method used to confirm the issue.


For full implementation details, code examples, and framework-specific guidance, see references/rule.md.

Rule page: https://frontendchecklist.io/rules/performance/js-redirects

FAQ

Why are server redirects faster?

The skill says a JavaScript redirect needs the page and script to load first, which adds an extra round trip.

Are server redirects better for SEO?

The skill says client-side redirects can hurt SEO, while server-side redirects are more search-friendly.

Where should the redirect be set?

The skill suggests the web server or edge configuration.

Details

Original description by the author

Use when auditing slow page loads, heavy assets, or rendering delays related to Avoid JavaScript-based redirects. Verify the actual bottleneck in DevTools, Lighthouse, or field data before recommending changes.

repo: thedaviddias/Front-End-Checklist

Popularity

GitHub stars
75k
Ranking position
#2905
License
MIT
Updated
10/31/2026

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills