this post was submitted on 01 Apr 2026
4 points (100.0% liked)

Programming

26304 readers
608 users here now

Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!

Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.

Hope you enjoy the instance!

Rules

Rules

  • Follow the programming.dev instance rules
  • Keep content related to programming in some way
  • If you're posting long videos try to add in some form of tldr for those who don't want to watch videos

Wormhole

Follow the wormhole through a path of communities !webdev@programming.dev



founded 2 years ago
MODERATORS
 

crosspost: https://lemmy.world/post/45022275

Hi

Hello, I created this project with the goal of quickly setting up a template using Nuxt and the “On-demand revalidation” configuration, integrated with a backend (currently only Pocketbase).

While researching, I discovered that “On-demand revalidation” is a very valid option for saving server resources in exchange for having more data in the cache, but this option requires integration with the backend you use in your project.

Workflow

  1. The user visits a page

  2. The server checks if that page exists in the cache

  3. If it exists in the cache, Nitro returns the cached page, and Nitro checks in the background whether the backend data has changed by reviewing “the data block”; since the backend did not send any signal, Nitro returns “the data block” from the cache

  4. If the page does not exist in the cache, it generates a new page, and Nitro checks if there is a “data block” in the cache; if there isn’t, it fetches the data from the backend

  5. Nitro’s configuration ensures that when a fetch is performed, that data is stored in the cache; that “data block” will expire in one week unless the backend sends an event to reset it.

  6. If the data changes on the backend, it sends an event to reset the cache in Nitro

You can run the script with bun, npm or pnpm

Example

npx nurev  

More info

https://codeberg.org/Serroda/nurev#how-it-works

Take a look and let me know what you think
Have a good day!

no comments (yet)
sorted by: hot top controversial new old
there doesn't seem to be anything here