SShortSingh.
Back to feed

Use the existing query-key factory instead of hand-typed keys to avoid stale caches

0
·8 views

The article argues that components fetching resources with hand-typed query keys like ['user', id] can break cache invalidation when a repo already provides a query-key factory. A mismatched key can leave list views stale after a successful mutation, or split one entity across separate cache slots. The author recommends that new queries and mutations use the shared factory, that invalidation rely on its prefix helpers, and that new resource keys be added to the factory rather than invented in feature files. The piece also offers review guidance, such as searching diffs for raw key arrays and rejecting handmade keys that bypass the factory.

Read the full story at DEV Community

This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)

Log in to join the discussion and vote.

Log in

Related stories

0
ProgrammingDEV Community ·

Why PDF annotations shift when a page is rotated or zoomed

A PDF annotation can appear misplaced in a viewer even when pointer coordinates seem correct, because the page may be rotated, zoomed, or displayed at a different size than its canvas. Overlays aligned at 100% zoom can drift when the view changes. The recommended fix is to store annotations in PDF page coordinates and convert them to viewport coordinates for display and back again when editing. PDF.js provides viewport conversion methods that handle differences in origin, scale, and rotation more reliably than manual Y-axis flipping. Developers are advised to test by rotating and zooming a page and reopening the saved file in another viewer to verify placement.

0
ProgrammingDEV Community ·

AntelopeJS DMS Generates Back-Office Dashboards from Database Schemas

AntelopeJS DMS is an open-source, Apache-2.0 tool that a service company built to replace hand-coded back offices for client projects. Users paste a database connection string, and an AI assistant draws a live mockup of proposed admin screens, which can be refined by pinning comments on blocks. Once approved, the assistant writes the pages as typed TypeScript in the user's repository and checks them against the mockup in a headless browser. In the company's test on a 12-table sample coffee shop database, one run produced a dashboard and 11 table pages, about 2,100 lines of TypeScript that typechecked. The assistant runs on the user's own Claude or Codex subscription, and the tool is self-hosted with no model hosted by its developers.

0
ProgrammingDEV Community ·

Comparing Render, Railway, Scalingo and QuickTane for a small EU-hosted Docker app in 2026

A developer benchmarks four hosting platforms for a typical small app: one 512 MB container, a PostgreSQL database, a custom domain and EU-based data residency, using November 2026 public pricing. Render and Railway bill in USD while Scalingo and QuickTane bill in EUR, and the comparison notes differences in company headquarters and EU region locations such as Frankfurt, Amsterdam, Paris and Poland. Estimated monthly costs come out to roughly $13 to $26 for Render, usage-based and hard to predict for Railway, about €21.60 for Scalingo, and about €8 for QuickTane. The author, who builds QuickTane, lists each platform's strengths and limitations, including managed database features, certifications, deployment methods and scaling constraints.

0
ProgrammingDEV Community ·

Sanity for Beginners: A Headless CMS That Stores Content as Structured Data

Sanity is a headless CMS that models content as structured data rather than fixed pages, letting developers define content types such as blog posts in code. Editors work in a schema-driven studio with live preview and built-in real-time collaboration, while the frontend retrieves content as JSON through an API using the GROQ query language. The platform suits blogs, documentation and marketing sites, and projects that reuse the same content across several channels, and its free tier is generous for beginners. Its drawbacks include hosting content on Sanity's cloud and learning GROQ, so simpler tools like Markdown files may suit very small personal blogs better. Beginners are advised to try a free project with one content type and fetch its content from a small script.