Idea: asynchronously load images from GCS #51105
Labels
No Label
legacy project
Infrastructure: Websites
legacy project
Pillar
legacy project
Pillar Framework
legacy project
Pillar Website
Priority::High
Priority::Low
Priority::Normal
Status::Archived
Status::Confirmed
Status::Resolved
Type::Bug
Type::Design
Type::Patch
Type::Report
Type::To Do
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: archive/pillar#51105
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This is just an idea. Logging in to the cloud is slow, and I think that's partially because of the images on the activity stream. Other not-so-often visited pages with many images (such as some texture groups) are also very slow to load. I was thinking, maybe it's a good idea to not refresh the URL at GCS when the HTML loads. Instead, we use a placeholder image for all images with expired links, and put the file ObjectID into a data attribute. Then some JavaScript can asynchronously fetch all those from our server from a special end-point that'll refresh the URLs.
Of course we'll have to think about the security implications for this. Maybe using the file ObjectID is a bad idea, because it's too easy to guess other IDs. A special endpoint serving files by ObjectID will allow a user to simply increment the ObjectIDs until files from someone else's project are returned.
Still, I think it's worth thinking about, as it may give a significant (perceived) speedup of the cloud.
Changed status to: 'Open'
Added subscribers: @dr.sybren, @fsiddi, @pablovazquez
Would be great to somehow retrieve or the height/width of the file so the placeholders don't break the layout. In most cases we know the size of thumbnails (group view, frontpage), but when the images are responsive we don't.
The sizes are stored in the file document, which needs to be accessed anyway to figure out whether links are outdated or not. I'm sure we can get those values into the Jinja template context.
Changing to low prio since we have a Celery task that actively refreshes expired links.