# Dashboard State in URL Params and Next.js unstable\_cache

> Two implementation patterns for shareable, high-performance Next.js admin dashboards

This note outlines two practical architecture patterns for building admin analytics dashboards in Next.js. Storing active filters and date ranges in URL query parameters ensures views can be directly bookmarked and shared. Pairing these parameters with Next.js unstable\_cache prevents redundant database queries across shared views.

## How it works

1) Page state is stored in URL params so dashboards are easy to share, e.g. /admin?from=2024-10-02&to=2024-10-08&preset=last7days. 2) All database queries are cached using Next.js unstable\_cache (docs: https://nextjs.org/docs/app/api-reference/functions/unstable\_cache).

## What it is for

- Make dashboard filter states and date ranges easily shareable via browser URLs
- Reduce database load on analytics queries using Next.js data caching
- Design robust internal admin tooling with shareable state by default

## Key points

- Syncing active filters, presets, and date ranges directly to URL search parameters
- Facilitating direct link sharing with pre-configured dashboard state
- Wrapping database queries in Next.js unstable\_cache for efficient data reuse

## Pricing

Free

## Details

- Type: Tip
- Category: [Development](https://xiry.app/topics/development.md)
- Open source: no
- Platforms: Web
- For: Next.js and full-stack web developers building dashboards and internal tools
- Tags: nextjs, react, dashboards, caching, state management, web dev

## Why it was saved

- [@dillionverma, 8 October 2024](https://x.com/dillionverma/status/1843762626599497953): Reusable patterns for shareable, cached dashboard pages.

## Related

- [Shadcn Dashboard](https://xiry.app/resources/shadcn-dashboard): Open-source dashboard kit and UI blocks built with shadcn/ui and Base UI (Website, Freemium)
- [shadcn/ui](https://xiry.app/resources/shadcn-ui-1902): Copy-paste React UI components built with Tailwind CSS and Radix primitives. (Website, Open source)
- [Efferd](https://xiry.app/resources/efferd): Pre-built, responsive shadcn/ui blocks and layouts for React applications (Web app, Freemium)
- [Spell UI](https://xiry.app/resources/spell-ui): Refined, copy-paste React and Tailwind CSS components with micro-interactions (GitHub repo, Open source)
- [Above-the-Fold Deferred Rendering Pattern](https://xiry.app/resources/above-the-fold-deferred-rendering-pattern): Performance pattern for deferring below-the-fold components to accelerate perceived page load. (Tip, Free)
- [Cult UI](https://xiry.app/resources/cult-ui-2540): Open-source animated UI components and blocks built for shadcn/ui projects (Website, Free)

Updated 11 October 2026. Page: https://xiry.app/resources/dashboard-state-in-url-params-and-next-js-unstable-cache

Make your own library: Xiry takes your saved reels, tweets, Reddit bookmarks and Watch Later videos, makes them searchable and pulls the useful stuff out, like this library. It's invite-only for now; join the waitlist at https://xiry.app/#waitlist.
