Foros de discusión

L5.2.3 - gzip / minify css not working

thumbnail
nicolas saubi, modificado hace 10 años.

L5.2.3 - gzip / minify css not working

Junior Member Mensajes: 43 Fecha de incorporación: 28/10/09 Mensajes recientes
--settings--
Liferay 5.2.3 on Tomcat 6.0
Front is Apache 2.2.9
--settings--

Hi,

it seems we encounter problems with our theme or portal configuration :
- our css are not merged to one main.css file,
- code in the css are not minified (spaces, line break, etc.)
- gzip seems not activated

Here follows our main.css code, our portal-ext conf and the reports from Page Speed.
If you need more informations feel free to ask, this point is prioritar here, so I'll answer quickly (French based, so Timezones matter)

Thanks for your time !


Main.css
/* This is the main CSS that includes other CSS files. */
@import url(base.css);
@import url(application.css);
@import url(layout.css);
@import url(navigation.css);
@import url(portlet.css);
@import url(forms.css);
@import url(custom.css);
@import url(login.css);


portal-ext.properties
locales=fr_FR
jdbc.default.jndi.name=jdbc/LiferayPool
open.id.auth.enabled=false
axis.servlet.hosts.allowed=***********
users.reminder.queries.enabled = false
terms.of.use.required =false
session.timeout.redirect.on.expire=true
dl.file.max.size=51200000
com.liferay.portal.upload.UploadServletRequestImpl.max.size=51200000
theme.css.fast.load=true
javascript.fast.load=true
lucene.store.type=file
lucene.store.jdbc.auto.clean.up=true
session.enable.url.with.session.id=false



Google Page Speed report

Minify CSS
Minifying the following CSS resources could reduce their size by 17.0KiB (19% reduction).

Minifying https://www.interiale.fr/interiale-theme/css/custom.css could save 5.9KiB (12% reduction). See optimized version
Minifying https://www.interiale.fr/interiale-theme/css/portlet.css could save 3.9KiB (40% reduction). See optimized version
Minifying https://www.interiale.fr/interiale-theme/css/application.css could save 3.3KiB (20% reduction). See optimized version
etc.


Enable gzip compression
Compressing the following resources with gzip could reduce their transfer size by 182.8KiB (71% reduction).

Compressing https://www.interiale.fr/interiale-theme/javascript/jquery-1.8.2.min.js could save 58.6KiB (64% reduction).
Compressing https://www.interiale.fr/interiale-theme/css/custom.css could save 39.6KiB (80% reduction).
Compressing https://www.interiale.fr/interiale-theme/javascript/jquery.validate.js could save 28.3KiB (74% reduction).
Compressing https://www.interiale.fr/interiale-theme/css/main.css?browserId=firefox&minifierType=css&t=1388492484000 could save 138B (49% reduction).
etc.
thumbnail
Bijan Vakili, modificado hace 10 años.

RE: L5.2.3 - gzip / minify css not working

Expert Mensajes: 375 Fecha de incorporación: 10/03/09 Mensajes recientes
Nicolas, good to see you there my friend.

Please do following steps to help resolve:

Attached the log from fresh portal restart. Browse to the theme and click around a bit. Attach log file here when this is done.

Something must be wrong because it should work.
thumbnail
nicolas saubi, modificado hace 10 años.

RE: L5.2.3 - gzip / minify css not working

Junior Member Mensajes: 43 Fecha de incorporación: 28/10/09 Mensajes recientes
Hi, and thanks for helping.

So, I removed all but base.css in the main.css file
I stopped server, cleared temp + work, removed the theme from webapps, started again server, and the deployed the theme.

In Chrome developer Tools, I can see (Sources tab) only 2 css files : base.css and main.css. They are not minified.

Archivos adjuntos:

thumbnail
nicolas saubi, modificado hace 10 años.

RE: L5.2.3 - gzip / minify css not working (Respuesta)

Junior Member Mensajes: 43 Fecha de incorporación: 28/10/09 Mensajes recientes
Update !

As a reminder the minifier was working on test server (and local server) but not on production server. Both portal-ext.properties were the same (beside DB conf), and included "theme.css.fast.load=true" and "javascript.fast.load=true".

I finally get rid of this "non minified css". After searching in the temp files from tomcat, I saw there was a tomcat/temp/minified/[theme] folder with the main.css minified on test but not on prod. Erasing all temp / work and removing the theme from webapps/ was not changing anything on prod.

What might have solved it, was to enter liferay command panel, go to server administration, resources, and clear all but the last 2 options (all but "reindex search index" and "init subject").
Then I hot deployed again the theme and finally got my main.css minified !

Hopes it will help understand what was going on, or help others people with the same issue.

Many thanks Bijan Vakili for the help here and on #liferay !
jose perez, modificado hace 7 años.

RE: L5.2.3 - gzip / minify css not working

New Member Mensaje: 1 Fecha de incorporación: 13/10/15 Mensajes recientes
which is the exact path where is the main.css file in tmp?