本文へスキップ
Skillpedia
WebサイトとUI(フロントエンド)75k · #2905

js-redirects

できること

このスキルは、JavaScriptでリダイレクトしているページを見つけ、代わりにサーバー側のリダイレクトを提案します。速く検索エンジンにも優しい移動を求める開発者向けです。

使う場面

  • ✓ページが読み込まれた後、スクリプトで訪問者を別の場所に送っているとき。
  • ✓ページを移動してリダイレクトが遅く感じるとき。
  • ✓検索エンジンがリダイレクトをうまく扱えていないように見えるとき。

スキルのリンク

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

コピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。

使い方

いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。

貼り付け用メッセージ

このスキルを使って手伝ってください:https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/js-redirects/SKILL.md このリンクのSKILL.mdファイルを読んで、私の作業でその指示に従ってください。
こういうスキルを、AIが自分で見つけてくれたら?無料のSkillpedia MCPをインストール。1行で、作業の前に15,000+のスキルから探してくれます。1分でインストール →

AIへの頼み方の例

“私のサイトのJavaScriptリダイレクトを、正しいサーバーのリダイレクトに置き換えてください。”

毎週5つの新しいスキル。1分で読めます。

仕組み

エージェントは、コード内のwindow.locationによるリダイレクトを検索し、Webサーバーまたはエッジの設定で301または302のルールに移すよう提案します。

技術的な内容(元のSKILL.md)

作者による元のテキスト(英語)を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

よくある質問

サーバー側のリダイレクトはなぜ速いのですか?

このスキルによると、JavaScriptのリダイレクトはページとスクリプトの読み込みを待つ必要があり、余分な往復が発生します。

サーバー側のリダイレクトはSEOに有利ですか?

このスキルによると、クライアント側のリダイレクトはSEOに悪影響を与えることがあり、サーバー側のリダイレクトは検索エンジンにより適しています。

リダイレクトはどこで設定すべきですか?

このスキルは、Webサーバーまたはエッジの設定を提案しています。

詳細

作者による元の説明

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

人気

GitHubのスター
75k
ランキング
#2905
ライセンス
MIT
更新日
2026/10/31

このスキルは役に立ちますか?

0

ログイン して投票しましょう。

コメント

  • …

このリポジトリの他のスキル

似ているスキル