Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/stscoundrel/dictionary-revalidator

Kotlin / Spring Boot API for triggering ISR revalidations in online dictionaries
https://github.com/stscoundrel/dictionary-revalidator

h2-database isr kotlin maven revalidation spring spring-boot

Last synced: 12 days ago
JSON representation

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

Awesome Lists containing this project

README

        

# 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](https://github.com/stscoundrel/cleasby-vigfusson-next)
- [Old Icelandic Dictionary](https://github.com/stscoundrel/old-icelandic-zoega-next)
- [Old Norwegian Dictionary](https://github.com/stscoundrel/old-norwegian-dictionary-next)
- [Old Swedish Dictionary](https://github.com/stscoundrel/old-swedish-dictionary-next)
- [Old Danish Dictionary](https://github.com/stscoundrel/old-danish-dictionary-next)

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.