diff options
| author | Bryce Kwon <bryce@brycekwon.com> | |
|---|---|---|
| committer | Bryce Kwon <bryce@brycekwon.com> | |
| commit | ||
| parent | ||
| tree | ||
| download | ||
Lazy load the avatar icons
Diffstat (limited to '')
| -rw-r--r-- | custom/extensions/email-libravatar.lua | 6 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
1 file changed, 5 insertions, 1 deletion
diff --git a/custom/extensions/email-libravatar.lua b/custom/extensions/email-libravatar.lua index ec35bc9..eceef56 100644 --- a/custom/extensions/email-libravatar.lua +++ b/custom/extensions/email-libravatar.lua @@ -92,6 +92,9 @@ function filter_write(text) buffer = buffer .. text end +-- A log page can carry one icon per commit, so the attributes let the +-- browser defer the fetches for icons still off screen and keep decoding +-- off the critical path. function filter_close() if avatar_hash == nil then html(buffer) @@ -101,7 +104,8 @@ function filter_close() "&d=" .. default_image .. "' width='" .. avatar_size .. "' height='" .. avatar_size .. - "' alt='" .. alt_text .. "' /> " .. buffer) + "' loading='lazy' decoding='async'" .. + " alt='" .. alt_text .. "'> " .. buffer) end return 0 end |
