Minify JS and CSS

Discussion regarding Joomla! 3.x Performance issues.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10.
Locked
AnandGIBES005
Joomla! Apprentice
Joomla! Apprentice
Posts: 34
Joined: Sun Apr 29, 2018 4:40 pm

Minify JS and CSS

Post by AnandGIBES005 » Fri Aug 30, 2019 9:22 am

Hi,

In the Joomla admin backend - I have enabled - Optimize CSS & JS - http://prntscr.com/ozj82r

However, as per https://gtmetrix.com/ - it is still suggesting to enable / minify jss and css.

So, please let me know - how to proceed ahead with it.

Regards.

User avatar
bruno28
Joomla! Guru
Joomla! Guru
Posts: 516
Joined: Wed May 16, 2012 5:41 am
Location: Chartres, France
Contact:

Re: Minify JS and CSS

Post by bruno28 » Fri Aug 30, 2019 9:52 am

Hello AnandGIBES005

Did you clear the Joomla cache and your browser cache ?
Cordialement, Bruno28 :)
Joomla! 3.9.23 - php 7.4
www.bp2i.fr - www.moneglisesurle.net

gws
Joomla! Virtuoso
Joomla! Virtuoso
Posts: 4175
Joined: Tue Aug 23, 2005 1:56 pm
Location: South coast, UK
Contact:

Re: Minify JS and CSS

Post by gws » Fri Aug 30, 2019 10:07 am

The gmetrix site offers you the option to download minified css and js.download and replace on your site.

AnandGIBES005
Joomla! Apprentice
Joomla! Apprentice
Posts: 34
Joined: Sun Apr 29, 2018 4:40 pm

Re: Minify JS and CSS

Post by AnandGIBES005 » Fri Aug 30, 2019 11:29 am

Yes, I have cleared the Joomla cache and your browser cache and it is still showing - http://prntscr.com/ozl4ve

As you have mentioned - http://prntscr.com/ozl58h
can you please share the url so that I can download it.

User avatar
bruno28
Joomla! Guru
Joomla! Guru
Posts: 516
Joined: Wed May 16, 2012 5:41 am
Location: Chartres, France
Contact:

Re: Minify JS and CSS

Post by bruno28 » Fri Aug 30, 2019 12:22 pm

GTmetrix propose you to download minified css and js as gws said on the right of the files with optimized version

gtmetrix.png

And if you want to cite a post, use the cite button above the message instead of doing screenshot, it's easier :)

cite.png
You do not have the required permissions to view the files attached to this post.
Cordialement, Bruno28 :)
Joomla! 3.9.23 - php 7.4
www.bp2i.fr - www.moneglisesurle.net

User avatar
john-doe
Joomla! Guru
Joomla! Guru
Posts: 988
Joined: Tue Apr 19, 2011 7:39 pm
Location: Colombia
Contact:

Re: Minify JS and CSS

Post by john-doe » Fri Aug 30, 2019 4:50 pm

I'm sorry it this looks like Hijacking but i'm curious about, Is there any plugin that renders the CSS and JS files, minifies them and when you need to edit them via template editor of the backend get straightened so you can edit your file and once saved gets minified for such services.

I know about that since I know that Typo3 CMS has something close to it but i never heard of it for Joomla. Because that might be a solution for this case.
www.aldemar-hernandez.com - Custom templates and design services.

User avatar
bruno28
Joomla! Guru
Joomla! Guru
Posts: 516
Joined: Wed May 16, 2012 5:41 am
Location: Chartres, France
Contact:

Re: Minify JS and CSS

Post by bruno28 » Fri Aug 30, 2019 5:07 pm

john-doe wrote:
Fri Aug 30, 2019 4:50 pm
I'm sorry it this looks like Hijacking but i'm curious about, Is there any plugin that renders the CSS and JS files, minifies them and when you need to edit them via template editor of the backend get straightened so you can edit your file and once saved gets minified for such services.

I know about that since I know that Typo3 CMS has something close to it but i never heard of it for Joomla. Because that might be a solution for this case.
Maybe JCH Optimize ?
Cordialement, Bruno28 :)
Joomla! 3.9.23 - php 7.4
www.bp2i.fr - www.moneglisesurle.net

Jim Holloman
Joomla! Intern
Joomla! Intern
Posts: 56
Joined: Thu Apr 25, 2013 4:05 am

Re: Minify JS and CSS

Post by Jim Holloman » Fri Sep 20, 2019 6:12 am

AnandGIBES005

Can you tell me where to find "Optimize CSS" and "Optimize JS". I do not find either in my Joomla Backup. I am using Ver. 3.9 with the Protostar template.

gws
Joomla! Virtuoso
Joomla! Virtuoso
Posts: 4175
Joined: Tue Aug 23, 2005 1:56 pm
Location: South coast, UK
Contact:

Re: Minify JS and CSS

Post by gws » Fri Sep 20, 2019 8:35 am

Jim Holloman wrote:
Fri Sep 20, 2019 6:12 am
AnandGIBES005

Can you tell me where to find "Optimize CSS" and "Optimize JS". I do not find either in my Joomla Backup. I am using Ver. 3.9 with the Protostar template.
See bruno28 second post.

User avatar
bruno28
Joomla! Guru
Joomla! Guru
Posts: 516
Joined: Wed May 16, 2012 5:41 am
Location: Chartres, France
Contact:

Re: Minify JS and CSS

Post by bruno28 » Fri Sep 20, 2019 9:47 am

In the Joomla admin backend - I have enabled - Optimize CSS & JS - http://prntscr.com/ozj82r
Jim Holloman wrote:
Fri Sep 20, 2019 6:12 am
AnandGIBES005

Can you tell me where to find "Optimize CSS" and "Optimize JS". I do not find either in my Joomla Backup. I am using Ver. 3.9 with the Protostar template.
Hello Jim Holloman

I think it is not with Joomla but with his template he could do this
Cordialement, Bruno28 :)
Joomla! 3.9.23 - php 7.4
www.bp2i.fr - www.moneglisesurle.net

Jim Holloman
Joomla! Intern
Joomla! Intern
Posts: 56
Joined: Thu Apr 25, 2013 4:05 am

Re: Minify JS and CSS

Post by Jim Holloman » Sat Sep 21, 2019 4:30 pm

I found an extension that is closely related:
https://extensions.joomla.org/extension/jch-optimize/

helpwithjoomla
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 106
Joined: Sat Sep 21, 2019 7:29 pm
Contact:

Re: Minify JS and CSS

Post by helpwithjoomla » Sat Sep 21, 2019 7:58 pm

We regularly use JCH Optimize. It's a great Extension for optimizing css and js files.

It can be difficult to minimize files NOT hosted on your server like the Google Fonts css file. You could download that css file, optimize it and then save it to your server. That would also require relinking to the file on your server instead of Googles file.

I'd use JCH Optimize and just live with whatever limitations you get.

You already have an "A" for PageSpeed which is really good!

AnandGIBES005
Joomla! Apprentice
Joomla! Apprentice
Posts: 34
Joined: Sun Apr 29, 2018 4:40 pm

Re: Minify JS and CSS

Post by AnandGIBES005 » Fri Oct 25, 2019 9:42 am

helpwithjoomla wrote:
Sat Sep 21, 2019 7:58 pm
We regularly use JCH Optimize. It's a great Extension for optimizing css and js files.
I tried to subscribe to JCH optimize their JMSuper Plan but it is showing an error - http://prntscr.com/pny5qk
As mentioned in the error message to try again to subscribe and I did that and again I got the same error message.

I have also sent them this query on their site contact us form - http://prntscr.com/pny70g - but I havent received any reply from their end.

So, please let me know - how to subscribe to it.

Regards.

helpwithjoomla
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 106
Joined: Sat Sep 21, 2019 7:29 pm
Contact:

Re: Minify JS and CSS

Post by helpwithjoomla » Fri Oct 25, 2019 5:34 pm

That's an issue with the JCH Optimize web site. They will have to assist you to resolve that issue.
Joomla Developers Available To Help With Joomla!
https://www.helpwithjoomla.com

User avatar
sozzled
Joomla! Exemplar
Joomla! Exemplar
Posts: 9880
Joined: Sun Jul 05, 2009 3:30 am
Location: Canberra, Australia

Re: Minify JS and CSS

Post by sozzled » Fri Oct 25, 2019 6:41 pm

This is a general comment and it reflects only my personal view.

Have you every wondered why more experienced members—i.e. people who have posted more than 1000 messages—of the forum community do not usually reply to questions about third-party extensions that claim to aggregate/"optimise"/obfuscate or minify JS and CSS on-the-fly? It is not because these extensions do not do what they claim to do. It is also not because more experienced members of this community dispute the "value" in minifying JS or CSS.

This topic was posted in the Performance - Joomla! 3.x. When we discuss performance, are we talking about the processing overhead involved at the server or the perceived "performance" of a website when viewed by the end user? If we're discussing the server overheads, then every plugin, every extra module, every additional piece of PHP that's used to create the HTML adds to the processing "performance". If we're talking about the "performance" of a website as perceived by the end user, there are all sorts of factors involved in that: e.g. what else is the end-user's device doing at the time, network capacity, browser capabilities, etc.

Yes, there are benefits in using minified JS and CSS. I don't think anyone would dispute that. The ways in which JS and CSS is minified, however, is an entirely different discussion. There's a cost in "performance" if JS and CSS is minified on-the-fly and while that cost may not be perceptible to the end-user, these so-called "metrics monitors" only draw part of the overall picture. In the end, it's the site owner who must decide for themselves whether the cost in "optimising" the HTML package is worth the effort put into doing it.

Lastly, do I, personally, use JCH_Optimize? The answer is irrelevant: we're not discussing my website(s) but, for the sake of complete disclosure, I don't use it.
https://www.kuneze.com/blog
“If you think I’m wrong then say, ‘I think you’re wrong.’ If you say ‘You’re wrong!’, how do you know?” :)

helpwithjoomla
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 106
Joined: Sat Sep 21, 2019 7:29 pm
Contact:

Re: Minify JS and CSS

Post by helpwithjoomla » Fri Oct 25, 2019 7:17 pm

Excellent comments sozzled!

I agree with all your points.

When using a tool like Google's PageSpeed or GTMetrix, optimizing css and js is recommended. Thus I think many people want to undertake the optimization. And if organic rankings is important to a person, then you want to do as much as possible to "please" google.

Extensions like JCH Optimize may not be an ideal technical solution, but they are a good option for someone at the novice level.

css and js files can, of course, be manually optimized thus removing the need for those options in JCH. But manual optimization has it's own issues. I usually only do that for sites with content and layout that rarely changes.

Ultimately this posted started with a question about optimizing js and css as suggested by GTMetrix.

We've all just been supplying options.

I would rather reply and give a person an option rather than just not replying at all.

Every user must make their own decisions about how best to proceed.
Joomla Developers Available To Help With Joomla!
https://www.helpwithjoomla.com

User avatar
sozzled
Joomla! Exemplar
Joomla! Exemplar
Posts: 9880
Joined: Sun Jul 05, 2009 3:30 am
Location: Canberra, Australia

Re: Minify JS and CSS

Post by sozzled » Fri Oct 25, 2019 7:31 pm

Thank you for your reply, @helpwithjoomla. I agree that, for novice users, CSS and JS aggregation solutions may be useful but there can be unintended consequences in using third-party aggregators (e.g. JCH_Optimize). That's not why I was offering my opinion.

As I wrote, this topic was posted in the Performance - Joomla! 3.x forum category and it's important to understand what kind of "performance" we're discussing. Obviously, a website that downloads a hundred images in the HTML package will not perform as well as a one-page website that contains mostly text. Regardless of whether that "text" involves the use of JS or CSS, performance analysers such as the ones you've mentioned will report different conclusions.

In the end, the effort involved in achieving an "A" result may outweigh the value of the website's usefulness to the end-user. It stands to reason that, if the end-user has to wait more than a few seconds before the website's page is displayed, the end-user will probably give up and go somewhere else. In situations where a website produces Mbytes of data that has to be trafficked to its users, CSS and JS optimisation is at the tail end and such tools rarely result in more than a few percent improvement in overall performance.

Every website is different. Everyone's measure of "performance" is probably different, too. Beyond that, I can't say much else. Cheers. 8)
https://www.kuneze.com/blog
“If you think I’m wrong then say, ‘I think you’re wrong.’ If you say ‘You’re wrong!’, how do you know?” :)


Locked

Return to “Performance - Joomla! 3.x”