Hey! I'm building an inspiration library website using Astro + Sanity. I’ll have a few thousand "inspiration" items (videos) that are tagged with a structured tag system (category > subcategory > tag).
I want users to be able to filter the gallery by selecting tags (e.g., "Element: Modal", "Context: FAQ") — and the gallery should only show matching items. This should be dynamic and client-side, no page reloads. On first visit, they see all items sorted by recency, and the gallery uses lazy loading (or infinite scroll).
Right now, my plan is to fetch all the Sanity data at build time and save it as two static JSON files (/data/inspiration.json and /data/tags.json). Then I’d do all the filtering in the browser by loading those JSON files client-side.
Is that a good approach in Astro? Or is there a better way to structure this with newer Astro features (like islands, partial hydration, SSR, or any other new optimization pattern)? I’m not doing this for SEO, just for a fast and smooth user experience.
Any advice on the best way to structure this in Astro 4+ would be really appreciated. Thanks!