Question: Any good SMF mods to auto minify .css and .javascript theme files?

Started by Wellwisher, February 27, 2016, 10:24:46 PM

Previous topic - Next topic

Wellwisher

Question: Any good SMF mods to auto minify .css and .javascript theme files?

I enjoy making .css and .js design and speed improvements on my forum (a lot) so was wondering if there was a mod that automatically took care of this for me?

Kindred

Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Wellwisher

Quote from: Kindred on February 27, 2016, 10:25:49 PM
Don't think so...   I doubt the saving is all that much anyway

Yeah Kindred, I couldn't find anything on the matter but perhaps one of you folks made something on GH or somethng and point me in the right direction, would be great.

I require something simple as, whenever i make an edit to .css or .js file, I can click "re-minify" from admin and it will update the minified files.

Kindred

Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

feline

Well, well .. it do exist  :) we use our own js and css compress for our Portal Software .. but only for SMF 2.1 ...

Kindred

well, I did qualify my "certain" with a "virtually" :)

and I was not completely wrong... it doesn't exist for 2.0.x, AFAWK
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."


Antechinus

In the meantime, if you want awesome javascript compression: http://www.bananascript.com/index.php?compress


Try it on an already minified library, like the latest jQ, to see what it's capable of. The only catch is that the output is not, at all, readable by humans.

Biology Forums

Hence my suggestion is better (that is, if you have server-side access). It keeps all html, css, javascript, as they are, but minifies them for browsers. I've currently disabled it on my server because i'm making changes, and this causes caching issues, but when I activate, look at the source code, it's beautiful lol

Antechinus

The point is that bananascript does a far better job of compression than standard js minification. It's ideal for when you are not going to make any more changes, or at least not for a while.


Wellwisher

Quote from: Shuban on February 28, 2016, 04:15:15 PM
Okay, it has been activated, take a look (using Chrome):

HTML page: view-source:http://biology-forums.com/index.php?topic=400520

Javascript: http://biology-forums.com/Themes/default/scripts,_switchcontent.js+scripts,_tabcontent.js+scripts,_ajaxtabs.js+sha1.js.pagespeed.jc.BbEhf7JUUj.js

@Shuban This stuff is actually quite interesting. It may quench my need for speed.

Questions: So just to make sure, this google page insight doohickey leaves all the original .javascript, .css files as they are in SMF right (uncompressed, un-minified and still readable)? All I do is get my host to install it, and that's it? It will then magically convert all files, including html into some code only readable by Neo?

Biology Forums

You've described it perfectly.. all files remain the same, the server takes care of the rest. You also have to put a small code in .htaccess, which I will share when I'm on my PC

Wellwisher

Also some instructions to disable it - if need be would great. Cheers dude.  ;)

Biology Forums

Quote from: Wellwisher on February 28, 2016, 07:53:49 PM
Also some instructions to disable it - if need be would great. Cheers dude.  ;)

Ok, open .htaccess

To enable:

<IfModule pagespeed_module>
ModPagespeed ON
ModPagespeedEnableFilters collapse_whitespace
</IfModule>


To disable:

<IfModule pagespeed_module>
#ModPagespeed ON
#ModPagespeedEnableFilters collapse_whitespace
</IfModule>


Voila

Wellwisher

Quote from: Shuban on February 29, 2016, 02:20:46 PM
Quote from: Wellwisher on February 28, 2016, 07:53:49 PM
Also some instructions to disable it - if need be would great. Cheers dude.  ;)

Ok, open .htaccess

To enable:

Quote<IfModule pagespeed_module>
   ModPagespeed ON
   ModPagespeedEnableFilters collapse_whitespace
</IfModule>

To disable:

<IfModule pagespeed_module>
#ModPagespeed ON
#ModPagespeedEnableFilters collapse_whitespace
</IfModule>


Voila

My love grows for you @Shuban. I will try this out and report back. If it's that easy, more people should be using it. This stuff looks sexy alright. Who can say no to free speed? All your .html, .css, .js and images compressed and optimised for free. It's an incredible concept. 8)

Questions:

1. If I have other installs such as Wordpress, Joomla (basically if i have other cms installed) this will convert them into speed-freaks too?

2. Say if i *only* wanted my SMF install to be targetted is this possible?

3. Using this have you encountered any conflicts regards to your SMF install/ mods (apart from the caching issue)?

Advertisement: