-
-
Notifications
You must be signed in to change notification settings - Fork 274
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
Update status badges for Anaconda.org #2278
Update status badges for Anaconda.org #2278
Conversation
✅ Deploy Preview for conda-forge-previews ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
useEffect(() => { | ||
void (async () => { | ||
try { | ||
const response = await (await fetch(urls.repos.cdn.api)).text(); | ||
const updated = new Date(response.trim()).getTime(); | ||
const response = await (await fetch(`${urls.repos.cdn.api}?bustcache=${Date.now()}`)).json(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Weird that we need this bustcache
trick again (also needed in the packages page for the RSS stuff). Is this a conda.anaconda.org
misconfiguration? We don't need it for e.g. raw.githubusercontent.com
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jaimergp I'll look into how we can improve that this week. We explicitly purge all updated files from the Cloudflare cache at the end of each cache run.
However, we do also set a Cache-Control: public, max-age=1200
header in responses so that clients don't always download the files anew.
I expect that this leads to the effect that the status does not update: If the browser requests the file when the last update was 19 minutes ago, it will serve it from cache for the next 20 minutes, so it will show the last update being 39 minutes ago even though there should have been another update in the meantime.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe the max-age
for these status files (last_updated.json
, rss.xml
, etc) should be smaller, like a minute or something? I'm busting the browser cache with these ?bustcache=<timestamp>
hacks but ideally we wouldn't need them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup, my thoughts exactly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd stick with the work-around for now.
the preview says the CDN is down. is that true? |
@beckermr This is how it looks for me right now: |
Oh weird. I saw that it had been delayed 40 minutes when I looked last. Maybe that was the first one? |
@beckermr I think you most likely ran into the issue I just described in #2278 (comment). If in doubt (until we have improved that), hard refresh the page. |
PR Checklist:
docs/
orcommunity/
, you have added it to the sidebar in the corresponding_sidebar.json
fileComes from #2272 (comment)