Skip to Content
Odoo Menú
  • Registra entrada
  • Prova-ho gratis
  • Aplicacions
    Finances
    • Comptabilitat
    • Facturació
    • Despeses
    • Full de càlcul (IA)
    • Documents
    • Signatura
    Vendes
    • CRM
    • Vendes
    • Punt de venda per a botigues
    • Punt de venda per a restaurants
    • Subscripcions
    • Lloguer
    Imatges de llocs web
    • Creació de llocs web
    • Comerç electrònic
    • Blog
    • Fòrum
    • Xat en directe
    • Aprenentatge en línia
    Cadena de subministrament
    • Inventari
    • Fabricació
    • PLM
    • Compres
    • Manteniment
    • Qualitat
    Recursos humans
    • Empleats
    • Reclutament
    • Absències
    • Avaluacions
    • Recomanacions
    • Flota
    Màrqueting
    • Màrqueting Social
    • Màrqueting per correu electrònic
    • Màrqueting per SMS
    • Esdeveniments
    • Automatització del màrqueting
    • Enquestes
    Serveis
    • Projectes
    • Fulls d'hores
    • Servei de camp
    • Suport
    • Planificació
    • Cites
    Productivitat
    • Converses
    • Validacions
    • IoT
    • VoIP
    • Coneixements
    • WhatsApp
    Aplicacions de tercers Odoo Studio Plataforma d'Odoo al núvol
  • Sectors
    Comerç al detall
    • Llibreria
    • Botiga de roba
    • Botiga de mobles
    • Botiga d'ultramarins
    • Ferreteria
    • Botiga de joguines
    Food & Hospitality
    • Bar i pub
    • Restaurant
    • Menjar ràpid
    • Guest House
    • Distribuïdor de begudes
    • Hotel
    Immobiliari
    • Agència immobiliària
    • Estudi d'arquitectura
    • Construcció
    • Gestió immobiliària
    • Jardineria
    • Associació de propietaris de béns immobles
    Consultoria
    • Empresa comptable
    • Partner d'Odoo
    • Agència de màrqueting
    • Bufet d'advocats
    • Captació de talent
    • Auditoria i certificació
    Fabricació
    • Textile
    • Metal
    • Mobles
    • Menjar
    • Brewery
    • Regals corporatius
    Salut i fitness
    • Club d'esport
    • Òptica
    • Centre de fitness
    • Especialistes en benestar
    • Farmàcia
    • Perruqueria
    Trades
    • Servei de manteniment
    • Hardware i suport informàtic
    • Sistemes d'energia solar
    • Shoe Maker
    • Serveis de neteja
    • Instal·lacions HVAC
    Altres
    • Nonprofit Organization
    • Agència del medi ambient
    • Lloguer de panells publicitaris
    • Fotografia
    • Lloguer de bicicletes
    • Distribuïdors de programari
    Browse all Industries
  • Comunitat
    Aprèn
    • Tutorials
    • Documentació
    • Certificacions
    • Formació
    • Blog
    • Pòdcast
    Potenciar l'educació
    • Programa educatiu
    • Scale-Up! El joc empresarial
    • Visita Odoo
    Obtindre el programari
    • Descarregar
    • Comparar edicions
    • Novetats de les versions
    Col·laborar
    • GitHub
    • Fòrum
    • Esdeveniments
    • Traduccions
    • Converteix-te en partner
    • Services for Partners
    • Registra la teva empresa comptable
    Obtindre els serveis
    • Troba un partner
    • Troba un comptable
    • Contacta amb un expert
    • Serveis d'implementació
    • Referències del client
    • Suport
    • Actualitzacions
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Programar una demo
  • Preus
  • Ajuda

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Comptabilitat
  • Inventari
  • PoS
  • Projectes
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Etiquetes (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Etiquetes (View all)
odoo accounting v14 pos v15
About this forum
Ajuda

web.assets_frontend_lazy.min.js file is heavily unminified and open for lots of improvement

Subscriure's

Get notified when there's activity on this post

This question has been flagged
pagespeedperfomance
3 Respostes
11423 Vistes
Avatar
Juan Valencia

Hi all,

Lately I've been playing a lot with PageSpeed Insights improving the performance of my website (with Online Odoo hosting) for SEO purposes and I've come to the point where the file web.assets_frontend_lazy.min.js is the performance bottleneck.


Even though it is supposed to be minified it is heavily unminified. Around line 9787 all the way to the end line, 12278, there is a QWEB code with heavy indentation, lots of extra whitespaces and comments. Why is there a qweb template loaded into a JS variablie in a file that is supposed to be JS minified only... Anyway, the rest of the file seems properly minified with uselful comments left as title to split the code into chunks. That's good.


So, with this in mind I did a test. Downloaded that file (2.4MB !), applied a conservative minifying algorithm eliminating mostly just comments (no uglyfiyng!) and size went down to 2.25MB, and then a bit more by doing some manual whitespacing removal in my script editor for a total savings of let's round it up to 6.5% of file size. (That's a lot for just extra whitespace and comments). Then reuploaded it into the database replacing the original bundle and ran more PageSpeed tests. 

My mobile homepage was scoring around 75 with the best score at 79 with about 800ms blocking time.  I ran more tests and immediately got multiple results over 80, with the highest at 84 with a blocking time of 530ms. I conclude the results went up by 5 points in performance alone from merely removing comments and whitespace. A massive improvemet.

 

The point I want to make for the Odoo team is that further minifying that file will heavily increase performance for all users. Keep mind that the browser will stop the page rendering while downloading the brotli compressed web.assets_frontend_lazy.min.js (603kb (default) vs 571kb (modified)), uncompress it, parse the JS (bottleneck is here), execute and render the page. 

Further improvements could be made by even removing some legacy functions in that file. Also, archiving some Assets helps to reduce the JS file a bit, however, there are only about 20-30 js assets that can be archived. Way more assets need to be made accesible for end users to archive them.


Thanks!

0
Avatar
Descartar
Avatar
shraddha
Best Answer

From where I can get the lazyload assets was not able to find it got an error Uncaught promise error under the lazyload min js file but was not able to find it through developer section.

0
Avatar
Descartar
Avatar
Juan Valencia
Autor Best Answer

Hi Julien, 

Thanks for replying here and via support ticket.

Interesting, didn't know Odoo was open source. Cool. Maybe in the future I could do a PR. 

I'm using the Odoo online hosted option (enterprise). Where exactly can I find the python files mentioned in those documents? I'm searching the manifest one but can't find it. All I can find are these Assets but they are quite limited.

 

If my understading is correct, the python framework is only available to the either those hosting the open source version or the .sh plan, right? but that framework isn't available for the enterprise option as they are managed by Odoo themselves. So, coming back to the original topic of this post, that means that if I want to further improve the web.assets_frontend_lazy.min.js file, my only option is editing it after it is automatically compiled and then re uploading to the backend?

0
Avatar
Descartar
Avatar
Julien Launois (jula)
Best Answer

Hi Juan !

Here is the documentation about assets bundles https://www.odoo.com/documentation/16.0/developer/reference/frontend/assets.html

Basically every module has a manifest file where it defines which file should be in which asset bundle.

The process of retrieving the file paths to be included in those bundles is done here: https://github.com/odoo/odoo/blob/16.0/odoo/addons/base/models/ir_asset.py#L90

The minifying process is done here:

https://github.com/odoo/odoo/blob/16.0/odoo/addons/base/models/assetsbundle.py


If you have ideas about improving those processes you are more than welcome to contribute. Here is how you can do that: https://github.com/odoo/odoo/wiki/Contributing. Feel free to report some issues or even make a PR !
0
Avatar
Descartar
Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Registrar-se
Related Posts Respostes Vistes Activitat
Performace relation to image (media) files in Odoo
images perfomance odoo18 odoo17
Avatar
0
d’oct. 24
1783
Which is better Odoo13 Point of Sale or Odoo14 Point of Sale?
point_of_sale Odoo13 v14 perfomance
Avatar
Avatar
1
de des. 21
2543
Odoo.sh far too slow on mobile
performance hosting loading assets pagespeed
Avatar
0
de des. 25
3752
Users Table takes too much time to load when having more than 100000 portal users.
postgresql optimization loading Odoo13.0 perfomance
Avatar
0
de juny 24
2116
Is it useful to use Varnish, Nginx, and ngx_pagespeed with Odoo v8? Solved
configuration cache nginx optimization webserver Varnish pagespeed caching vcl
Avatar
1
de maig 24
16744
Community
  • Tutorials
  • Documentació
  • Fòrum
Codi obert
  • Descarregar
  • GitHub
  • Runbot
  • Traduccions
Serveis
  • Allotjament a Odoo.sh
  • Suport
  • Actualització
  • Desenvolupaments personalitzats
  • Educació
  • Troba un comptable
  • Troba un partner
  • Converteix-te en partner
Sobre nosaltres
  • La nostra empresa
  • Actius de marca
  • Contacta amb nosaltres
  • Llocs de treball
  • Esdeveniments
  • Pòdcast
  • Blog
  • Clients
  • Informació legal • Privacitat
  • Seguretat
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk slovenščina Español (América Latina) Español ภาษาไทย Türkçe українська Tiếng Việt

Odoo és un conjunt d'aplicacions empresarials de codi obert que cobreix totes les necessitats de la teva empresa: CRM, comerç electrònic, comptabilitat, inventari, punt de venda, gestió de projectes, etc.

La proposta única de valor d'Odoo és ser molt fàcil d'utilitzar i estar totalment integrat, ambdues alhora.

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now