stscoundrel / dictionary-revalidator

Kotlin / Spring Boot API for triggering ISR revalidations in online dictionaries

Home Page:https://dictionary-revalidator.onrender.com/health/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Dictionary Revalidator

Kotlin / Spring Boot API for triggering revalidation actions in various dictionary websites using incremental static generation.

Abstracts a few apikey / secret guarded endpoints in various dictionary projects under the same umbrella, allowing revalidation of pages using one API only.

Development

mvn clean && mvn spring-boot-run

The app requires few env vars. See .env.example.

Build

Build Docker image:

docker-compose build

Run Docker image:

docker-compose up

Why though

This is essentially just a web service version of existing revalidation scripts shipped with projects like Old Norse Dictionary, Old Icelandic Dictionary, Old Norwegian Dictionary and Old Swedish Dictionary.

Each of those sites contains too many statically generated pages to be deployed in one go to Vercel, as they hit Vercels per-build file limit. The solution has been to deploy them with only few core pages and use ISR to generate the pages as they are accessed for the first time. However, this first load may be bit too slow for casual browser and it actually consumes more resources than triggering API endpoint based revalidation. Considering that these sites are all hosted on free tiers, saving Vercels resources is both polite and required. Therefore, whenever new changes are deployed, new revalidation for tens of thousands of pages is needed.

About

Kotlin / Spring Boot API for triggering ISR revalidations in online dictionaries

https://dictionary-revalidator.onrender.com/health/

License:MIT License


Languages

Language:Kotlin 98.5%Language:Dockerfile 1.5%