I really like CDN pull zones. The way it works is: the CDN pulls over content as needed, and then caches it. It is great, because say you have a website with bunches of images, you just point them all at the CDN URL, and it will grab it from the normal location.
I do this on maiki.blog, so when I post to https://cdn.maiki.blog/example.png
, the CDN system will grab the image from https://maiki.blog/example.png
.
A lot of the options are configurable, so you can set how often it caches (most places default to 24 hours), how to purge the cache, and which domain to point at.
I really like this, but I want to do something else: I want to proxy data from multiple sources, for my build script.
Hugo has the ability to consume data for data templates, and I want to pull in a bunch, but once I start pinging three or four sources, I am going to be aware of how often I am requesting data, how often I rebuild the site, yadda yadda. I don’t want network connectivity to multiple nodes to be a requirement to deploy.
I’ve thought of two ways:
- Build a repo that is just data (JSON files or whatever), and load it as a sub-module at build time for the site, and that works. But it means I need a method to periodically pull down the latest data and commit it to the repo. Would be neat!
- Use a CDN-like proxy to save the data docs, and therefore is a single online point to pull data from.
I am not sure how to approach either of these. I mean, I guess I could cron job a build process for each data source if I were collecting them in a repo. GitLab can probably do everything for me, with a very complex .gitlab-ci.yml
.
But if I had a system where I could just feed it URLs and optionally an auth method, and then have my personal access ready, that is preferable! I also don’t need real-time feedback, so these data sources would be updated on 24 hour or 7 day cycles. A slow web approach to gathering data in one place.
I’ve started searching through the projects listed at https://github.com/Kickball/awesome-selfhosted#proxy, but nothing has popped out to me. Is there one or more projects I could use to put this together?