Docs
Protocol Verified

Routing Strategy

Slugs as Labels, IDs as Truth.

PRID: 1004
VERIFIED
1 min read

🧩 Routing: Slugs as Labels, IDs as Truth

In Instant Ship™, we have resolved the conflict between Named Parameters and Splats by introducing the Database Discovery Layer with ID-First Priority.


1. The "Slug is a Property" Mindset

We no longer treat the route parameter as the content source. Instead:

  1. The URL contains a Slug (User Friendly).
  2. The Link State contains the ID (System Friendly).
  3. The Page prioritizes the ID to fetch data instantly.

2. Strategic Benefits

  • Infinite Nesting: Since we query the database for the path/id, it doesn't matter if there are 2 segments or 20.
  • Dynamic Permalinks: You can change the slug of an article (e.g., from old-guide to new-guide) without losing the article's identity, as the ID remains constant.
  • Proxy Resilience: Even if the AI Studio Sandbox adds .html to your URL, the ID passed in state remains pure.

3. Final Architecture Choice

  • Docs: Use [...slug] to capture everything.
  • Blogs: Use $slug for flat structure.
  • Protocol: Both MUST implement the location.state.prid check before parsing the URL.

Key Lesson: Stop trying to parse structure from strings. Query structure from data using IDs.

Authority Distribution

Share this technical artifact