nodejs / release-cloudflare-worker

Infra for serving Node.js downloads and documentation.
https://nodejs.org/dist
MIT License
23 stars 7 forks source link

Use mtime in directory listings? #161

Closed targos closed 3 weeks ago

targos commented 3 weeks ago

Example: https://r2.nodejs.org/download/nightly/v21.0.0-nightly202307236c08b1fc02/docs/

It shows the date 04-Nov-2024 13:08 for apilinks.json, which is the last modification date on R2.

But rclone sets the actual modification date from the source as additional metadata: https://dash.cloudflare.com/07be8d2fbc940503ca1be344714cb0d1/r2/default/buckets/dist-prod/objects/nodejs%2Fnightly%2Fv21.0.0-nightly202307236c08b1fc02%2Fdocs%2Fapilinks.json/details

CleanShot 2024-11-04 at 13 15 27@2x

Should we use it to display more accurate information?

flakey5 commented 3 weeks ago

Sgtm, the files synced with the AWS client won't have them though so we'll need to check at render time

targos commented 3 weeks ago

I'm running full syncs with rclone, which adds the missing mtimes

targos commented 3 weeks ago

But I guess it doesn't hurt to have a fallback

targos commented 3 weeks ago

I opened https://github.com/nodejs/release-cloudflare-worker/pull/169 for single files. I'm not sure it can be done efficiently for directory listings, because ListObjectsV2Command doesn't return the custom metadata.