PerformanceHighlight of Weekly #005

Portal task avatars no longer embedded as base64

/my/tasks served avatars as base64, which could be several MB and could not be cached. It now uses /web/image URLs with an access token.

Versions20.0
ModulesProject project
AppServices

Pull requests and commits

BranchPull requestCommit
20.0odoo/odoo#296737 ↗5dc4d5d59f ↗

Commit message

[PERF] project: don't embed base64 images

In `/my/tasks` route, tasks assignee avatar image is embeded in the html
as base64.

Several problems:
- it can weigh a lot (several MB)
- it cannot be cached by browsers
- if the assingee apprears multiple time, the image is duplicated

Now we use `/web/image/...` URL
- with an access token to ensure the portal user can read the avatar
- with a `unique` query param to let browsers cache the image.

I tried it on a odoo.com staging, with a random partner list of tasks.

- before: 4.6MB transferred over network, resource size: 6.2MB
- after:   29kB transferred over network, resource size: 239kB

and images are cached after they are loaded once.

This is stable-friendly: existing databases continue with the old template
which still works. New databases gets the new optimized template.

task-6670541

My stack

Pick the versions and apps you run. Weekly digests, this week's table and All changes then show only what concerns you. Saved in this browser.

Versions
Apps
Modules