Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/stscoundrel/dictionary-revalidator
- Owner: stscoundrel
- License: mit
- Created: 2023-04-07T09:35:37.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-09-07T07:17:22.000Z (2 months ago)
- Last Synced: 2024-09-07T08:32:47.372Z (2 months ago)
- Topics: h2-database, isr, kotlin, maven, revalidation, spring, spring-boot
- Language: Kotlin
- Homepage: https://dictionary-revalidator.onrender.com/health/
- Size: 145 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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.