Skip to content
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

Merged
merged 1 commit into from
Aug 28, 2024

Conversation

jaimergp
Copy link
Member

PR Checklist:

  • note any issues closed by this PR with closing keywords
  • if you are adding a new page under docs/ or community/, you have added it to the sidebar in the corresponding _sidebar.json file
  • put any other relevant information below

Comes from #2272 (comment)

@jaimergp jaimergp requested a review from a team as a code owner August 27, 2024 17:11
Copy link

netlify bot commented Aug 27, 2024

Deploy Preview for conda-forge-previews ready!

Name Link
🔨 Latest commit f86d8f2
🔍 Latest deploy log https://app.netlify.com/sites/conda-forge-previews/deploys/66ce08d94ebe8400088c373b
😎 Deploy Preview https://deploy-preview-2278--conda-forge-previews.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

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();
Copy link
Member Author

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.

cc @jezdez @morremeyer

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.

Copy link
Member Author

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.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup, my thoughts exactly.

Copy link
Member

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.

@beckermr
Copy link
Member

the preview says the CDN is down. is that true?

@morremeyer
Copy link

@beckermr This is how it looks for me right now:
image

@beckermr
Copy link
Member

Oh weird. I saw that it had been delayed 40 minutes when I looked last. Maybe that was the first one?

@morremeyer
Copy link

@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.

@jaimergp jaimergp merged commit 50e02e1 into conda-forge:main Aug 28, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants