-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Add a GitHub workflow cache to manually purge the Cloudflare cache #2094
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: gh-pages
Are you sure you want to change the base?
Conversation
We had problems with the cache-purging logic in #2086, and then also in #2093. The symptom is that the CSS isn't loading, because the front-page still serves an older version (one that references a no-longer-existing CSS). The culprit seems to be the un-purged Cloudflare cache. Let's add a way to manually purge the cache. It is totally possible that this is one of those famous "Close Door" elevator buttons that fool us: https://www.sciencealert.com/the-close-door-buttons-in-elevators-don-t-actually-do-anything But in case it isn't, let's have a way to trigger a purge. Signed-off-by: Johannes Schindelin <[email protected]>
Do you think it would make sense to purge the Cloudflare cache on every deploy? I used to do that when I used Cloudflare for my personal site. |
Depending how often this happens (this is now the second time that I observed this within a short timespan), we might want to implement some more work-arounds:
I'd rather avoid this, as it is hacky, but hey, if it is necessary it is necessary. |
Oops, I missed that! In the past I've dealt with this by building a way to serve historical versions of the old CSS/JS (maybe for 6 weeks or so), I wonder if it would make sense to hack together some kind of system like:
Seems like probably too much work though, your idea to just try purging the cache again seems much easier. |
We could do this. Basically, we would add a new directory and after Hugo generated the files, copy the There is already a step in the |
Changes
Context
In #2086, and then also in #2093, we saw problems where the cache-purging logic that is supposed to be run as part of deploying the site seems not to have worked as expected. The symptom is that the CSS (whose file name now changes when its contents change) isn't loading, because the front-page still serves an older version (one that references a no-longer-existing CSS).
Let's add a way to manually purge the cache. It is totally possible that this is one of those famous "Close Door" elevator buttons that fool us into believing that we did something, anything. But just in case it isn't such a no-op, let's have a GitHub workflow so that we can trigger a Cloudflare cache purge manually.
Here is the workflow run that I would like to believe fixed the issue.