Server-side solution to minifying scripts and CSS stylesheets

Started by Biology Forums, May 27, 2015, 02:28:57 AM

Previous topic - Next topic

Biology Forums

I'm curious if anyone uses a server-side application that automatically reduces the size of linked .js files and CSS files by minifying them? I know I could manually minify these files, but that's problematic. Any solutions?

青山 素子

Google has published a module that can do that type of thing for both Apache HTTPd and Nginx. I do not have any direct experience with using this along with SMF, so you'll need to experiment if you try it.
Motoko-chan
Director, Simple Machines

Note: Unless otherwise stated, my posts are not representative of any official position or opinion of Simple Machines.


Antechinus

Elkarte has it built in, and their code is under an open license. Should be adaptable to SMF, since they share a lot in common.

Biology Forums

Since it's server-side, no back end coding is required, I don't think. I saved 200 kb per page load, however, by using mod_deflate, which comes preinstalled with apache. Not entirely sure how it works, but I think it compresses the files instead of real-time minifying them, which is what Google's module apparently does. I will try to install it tomorrow and will provide an update. Every kb counts as the community grows. Surprisingly, i don't have this issue with the mobile them, since a lot of the coding was omitted, including TPortal, and a lot of it was written from scratch. My default theme has a ton of what i like to call Junk HTML, which has accumulated over the years, especially during my inexperienced days as a webmaster

aegersz

fyi, i just installed Google's Pagespeed in an effort to lower my page build times ... so far, so good.

i don't really know how best to quantify the benefits but at least Apache still works ;).

The configuration of my Linux VPS (SMF 2.0 with 160+ mods & some assorted manual tweaks) can be found here and notes on my mods can be found here (warning: those links will take you to a drug related forum). My (House) music DJ dedication page is here

aegersz

The configuration of my Linux VPS (SMF 2.0 with 160+ mods & some assorted manual tweaks) can be found here and notes on my mods can be found here (warning: those links will take you to a drug related forum). My (House) music DJ dedication page is here

Advertisement: