<blog_post>

Smarter filtering in Astro: fast and SEO-friendly

How do you build a dynamic filtering system that loads fast and is SEO-proof? For Simyo, we developed a custom solution in Astro that checks every box.

Tyler
Tyler
  • 5 min read

The challenge: client-side filtering breaks SEO

Simyo.nl allows users to filter phones by brand, refurbished status and eSIM support. Until recently, all of this happened client-side via JavaScript. The result: long load times, layout shifts and non-indexable pages. Bad for users, worse for SEO.

Why? Because client-side filtering prevents search engines from accessing filtered pages. It also affects Core Web Vitals like Largest Contentful Paint and Cumulative Layout Shift. For an online-only brand like Simyo, every performance drop impacts visibility and traffic.


The limits of Astro

Astro is fast, lightweight and perfect for content-driven websites. But by default, it doesn’t support static or server-side rendering for query parameters. That means a URL like /phones?brands=apple can’t be pre-rendered as a unique page and won’t be indexed.

In commercial environments like Simyo’s, that’s a dealbreaker. Every filter combination represents a relevant search opportunity. Every missing index means lost traffic and conversions.


The solution: pre-rendered filter combinations

We explored three options: SSR with caching, middleware redirects and pre-rendering. The last was the most robust, scalable and SEO-friendly.

Our system:

  • A custom script generates all valid combinations
  • An Astro patch-package ensures paths are included during the build
  • A Fastify server rewrites query URLs into folder paths (using _query_)
  • Invalid combinations are excluded to keep the build lean
  • Multi-select filters are sorted for stable, unique URLs
  • Pipe-separators replace repeated parameters to reduce length and improve safety

The result: hundreds of prebuilt HTML pages, instantly served per combination.


Under the hood

  • filters.ts generates combinations based on metadata from the content directory
  • patch-package on Astro enables builds from dynamic paths
  • query-rewrite.ts intercepts incoming URLs and maps them to the correct static folder
  • Only valid combinations are included, 253 out of 576 in Simyo’s case
  • All output is semantic HTML, optimised for Core Web Vitals

The result: fast, scalable and SEO-first

For Simyo, this means:

  • Unique, indexable pages for every filter view
  • No JavaScript required to show content
  • No reliance on caching or SSR, everything is prebuilt
  • Scalable and low-maintenance, new filters only need updated logic

Performance improvements are tangible. The site is faster, more stable and easier to find. Less maintenance, more control.


Why this matters beyond Simyo

This approach applies to more than just telecom. Platforms for real estate, job boards, SaaS or product catalogs all benefit from similar filtering logic.

Pre-rendering filter pages offers full control over performance, SEO and user experience. And because the logic is dynamic, you can scale fast without bloated builds.

Bonus: this solution has already been proposed as a pull request within Astro. Soon, it could be part of the core framework.

<project.start>

Get your project started.