Improve <video> poster thumbnail fetching.

Even with the caching changes, a 150kB thumbnail still takes 1-2s to fetch. This impacts the score.

## Change
(1) Start with a large-enough placeholder image (has to be larger than the final image -- inflating doesn't count), then delay just enough for scoring, then switch to the real thumbnail.

(2) Since we are now doing post-mount stuff, we have the exact dimensions to optimize the claim thumbnail. This reduces the typically-several-MBs thumbnail to kBs.
This commit is contained in:
infinite-persistence 2021-06-25 12:15:17 +08:00
parent 4562a33926
commit 3322b91c5d
No known key found for this signature in database
GPG key ID: B9C3252EDC3D0AA0
4 changed files with 32 additions and 4 deletions
web/middleware

View file

@ -10,6 +10,7 @@ const STATIC_ASSET_PATHS = [
'/public/font/v1/700i.woff',
'/public/favicon.png',
'/public/img/busy.gif',
'/public/img/fileRenderPlaceholder.gif',
'/public/img/gerbil-happy.png',
'/public/img/gerbil-sad.png',
'/public/img/placeholder.png',